mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-16 18:56:00 +00:00
to js
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
const { db } = require("../../../index-.js");
|
||||
|
||||
module.exports = {
|
||||
name: "message",
|
||||
async execute(client, msg, Discord) {
|
||||
@ -6,9 +8,9 @@ module.exports = {
|
||||
const args = msg.content.split(" ");
|
||||
if (!args[1] || !args[2])
|
||||
return msg.channel.send(client.messages.setKeyUsage);
|
||||
if (!client.guilds.cache.get(args[2]))
|
||||
return msg.channel.send(client.messages.invalidGuild);
|
||||
client.global.db.guilds[args[2]].spotify_access_key = args[1];
|
||||
client.config.db.collection("guilds").doc(args[2]).set({
|
||||
key: args[1],
|
||||
});
|
||||
return msg.channel.send(client.messages.keySet);
|
||||
}
|
||||
if (!msg.guild) return;
|
@ -2,16 +2,16 @@ module.exports = function (client) {
|
||||
const Discord = require('discord.js');
|
||||
const events = './clientEvents/';
|
||||
client.on('ready', () => {
|
||||
require(`${events}ready.ts`).execute(client, Discord);
|
||||
require(`${events}ready.js`).execute(client, Discord);
|
||||
});
|
||||
client.on('message', (msg) => {
|
||||
require(`${events}msg.ts`).execute(client, msg, Discord);
|
||||
require(`${events}msg.js`).execute(client, msg, Discord);
|
||||
});
|
||||
client.on('guildCreate', (guild) => {
|
||||
require(`${events}guildCreate.ts`).execute(client, guild);
|
||||
require(`${events}guildCreate.js`).execute(client, guild);
|
||||
});
|
||||
client.on('voiceStateUpdate', (oldState, newState) => {
|
||||
require(`${events}voiceStateUpdate.ts`).execute(client, oldState, newState);
|
||||
require(`${events}voiceStateUpdate.js`).execute(client, oldState, newState);
|
||||
});
|
||||
client.on('error', (error) => {
|
||||
client.channels.fetch(client.config.debug_channel).send(`Error: ${error} on shard: ${client.shard}`);
|
Reference in New Issue
Block a user