diff options
Diffstat (limited to 'app.js')
| -rw-r--r-- | app.js | 23 |
1 files changed, 9 insertions, 14 deletions
@@ -1,39 +1,32 @@ +// TODO: add pause, resume and volume
+
const fs = require('fs');
const Discord = require('discord.js');
const config = require('./config.json');
const bot = new Discord.Client();
bot.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
-
for (const file of commandFiles) {
const command = require(`./commands/${file}`);
bot.commands.set(command.name, command);
}
-
+
bot.on('ready', () => {
console.log(`Started bot: ${bot.user.tag} (ID: ${bot.user.id})\nCurrently running on ${bot.guilds.size} server(s).`); // Startup dialouge in output console
bot.user.setActivity('psycho~ uwu', { // Set status
type: 'LISTENING'
});
-
- // Outputs available commands in output console
- //commands = ['bot', 'help'];
- //console.log(commands);
});
-// Outputs errors in console window
bot.on('error', console.error);
-// Start Bot Commands
bot.on('message', async msg => {
- //console.log(msg.content.toLowerCase());
//if (msg.channel.name === 'bots' || msg.channel.name === 'bot-commands' || msg.member.hasPermission('KICK_MEMBERS')) {
var msgContent = msg.content.toLowerCase();
if (prefixCheck()) {
console.log(msg.member.user.tag, 'says', msgContent, 'in #' + msg.channel.name);
}
- //console.log(config.prefixes.main);
// Check prefixies in config.json
function prefixCheck() {
@@ -111,16 +104,18 @@ bot.on('message', async msg => { if (msg.member.hasPermission(p)) return true;
}
- // Begin commands
- // if (command == 'ping') {
- // bot.commands.get('ping').execute(bot, msg);
- // }
+ // Main
try {
bot.commands.get(command).execute(msg, args, bot);
return;
} catch (error) {
console.error(error);
}
+
+ // Reacts with ping emoji when @everyone
+ if (msg.mentions.everyone) {
+ msg.react(':ArisaPing:695887537390223402');
+ }
//} else if (msg.channel.name !== 'bots' && msg.content.startsWith(`${config.prefixes.main}`) && !msg.member.hasPermission('KICK_MEMBERS')) return;
});
|