|
|
@@ -0,0 +1,77 @@
|
|
|
+const { Dice } = require('./dice')
|
|
|
+var Discord = require('discord.js');
|
|
|
+
|
|
|
+var bot = new Discord.Client()
|
|
|
+/*
|
|
|
+bot.on('ready', function() {
|
|
|
+// console.log('ready', arguments)
|
|
|
+ console.log('Logged in as %s - %s\n', bot.username, bot.id);
|
|
|
+});
|
|
|
+*/
|
|
|
+
|
|
|
+bot.on('message', function(message) {
|
|
|
+ if (message.author.id === bot.user.id) return;
|
|
|
+ const response = Dice.chat(message.content)
|
|
|
+ console.log(`message from ${message.author.username}: ${message.content}`)
|
|
|
+ if (response) {
|
|
|
+ console.log(response)
|
|
|
+ message.reply(response)
|
|
|
+ }
|
|
|
+});
|
|
|
+/*
|
|
|
+bot.on("any", function(event) {
|
|
|
+ console.log(event)
|
|
|
+});
|
|
|
+*/
|
|
|
+
|
|
|
+/*
|
|
|
+bot.on('channelCreate', function() { console.log('channelCreate', Array.from(arguments)) })
|
|
|
+bot.on('channelDelete', function() { console.log('channelDelete', Array.from(arguments)) })
|
|
|
+bot.on('channelPinsUpdate', function() { console.log('channelPinsUpdate', Array.from(arguments)) })
|
|
|
+bot.on('channelUpdate', function() { console.log('channelUpdate', Array.from(arguments)) })
|
|
|
+bot.on('clientUserGuildSettingsUpdate', function() { console.log('clientUserGuildSettingsUpdate', Array.from(arguments)) })
|
|
|
+bot.on('clientUserSettingsUpdate', function() { console.log('clientUserSettingsUpdate', Array.from(arguments)) })
|
|
|
+bot.on('debug', function() { console.log('debug', Array.from(arguments)) })
|
|
|
+bot.on('disconnect', function() { console.log('disconnect', Array.from(arguments)) })
|
|
|
+bot.on('emojiCreate', function() { console.log('emojiCreate', Array.from(arguments)) })
|
|
|
+bot.on('emojiDelete', function() { console.log('emojiDelete', Array.from(arguments)) })
|
|
|
+bot.on('emojiUpdate', function() { console.log('emojiUpdate', Array.from(arguments)) })
|
|
|
+bot.on('error', function() { console.log('error', Array.from(arguments)) })
|
|
|
+bot.on('guildBanAdd', function() { console.log('guildBanAdd', Array.from(arguments)) })
|
|
|
+bot.on('guildBanRemove', function() { console.log('guildBanRemove', Array.from(arguments)) })
|
|
|
+bot.on('guildCreate', function() { console.log('guildCreate', Array.from(arguments)) })
|
|
|
+bot.on('guildDelete', function() { console.log('guildDelete', Array.from(arguments)) })
|
|
|
+bot.on('guildMemberAdd', function() { console.log('guildMemberAdd', Array.from(arguments)) })
|
|
|
+bot.on('guildMemberAvailable', function() { console.log('guildMemberAvailable', Array.from(arguments)) })
|
|
|
+bot.on('guildMemberRemove', function() { console.log('guildMemberRemove', Array.from(arguments)) })
|
|
|
+bot.on('guildMembersChunk', function() { console.log('guildMembersChunk', Array.from(arguments)) })
|
|
|
+bot.on('guildMemberSpeaking', function() { console.log('guildMemberSpeaking', Array.from(arguments)) })
|
|
|
+bot.on('guildMemberUpdate', function() { console.log('guildMemberUpdate', Array.from(arguments)) })
|
|
|
+bot.on('guildUnavailable', function() { console.log('guildUnavailable', Array.from(arguments)) })
|
|
|
+bot.on('guildUpdate', function() { console.log('guildUpdate', Array.from(arguments)) })
|
|
|
+bot.on('message', function() { console.log('message', Array.from(arguments)) })
|
|
|
+bot.on('messageDelete', function() { console.log('messageDelete', Array.from(arguments)) })
|
|
|
+bot.on('messageDeleteBulk', function() { console.log('messageDeleteBulk', Array.from(arguments)) })
|
|
|
+bot.on('messageReactionAdd', function() { console.log('messageReactionAdd', Array.from(arguments)) })
|
|
|
+bot.on('messageReactionRemove', function() { console.log('messageReactionRemove', Array.from(arguments)) })
|
|
|
+bot.on('messageReactionRemoveAll', function() { console.log('messageReactionRemoveAll', Array.from(arguments)) })
|
|
|
+bot.on('messageUpdate', function() { console.log('messageUpdate', Array.from(arguments)) })
|
|
|
+bot.on('presenceUpdate', function() { console.log('presenceUpdate', Array.from(arguments)) })
|
|
|
+bot.on('rateLimit', function() { console.log('rateLimit', Array.from(arguments)) })
|
|
|
+bot.on('ready', function() { console.log('ready', Array.from(arguments)) })
|
|
|
+bot.on('reconnecting', function() { console.log('reconnecting', Array.from(arguments)) })
|
|
|
+bot.on('resume', function() { console.log('resume', Array.from(arguments)) })
|
|
|
+bot.on('roleCreate', function() { console.log('roleCreate', Array.from(arguments)) })
|
|
|
+bot.on('roleDelete', function() { console.log('roleDelete', Array.from(arguments)) })
|
|
|
+bot.on('roleUpdate', function() { console.log('roleUpdate', Array.from(arguments)) })
|
|
|
+bot.on('typingStart', function() { console.log('typingStart', Array.from(arguments)) })
|
|
|
+bot.on('typingStop', function() { console.log('typingStop', Array.from(arguments)) })
|
|
|
+bot.on('userNoteUpdate', function() { console.log('userNoteUpdate', Array.from(arguments)) })
|
|
|
+bot.on('userUpdate', function() { console.log('userUpdate', Array.from(arguments)) })
|
|
|
+bot.on('voiceStateUpdate', function() { console.log('voiceStateUpdate', Array.from(arguments)) })
|
|
|
+bot.on('warn', function() { console.log('warn', Array.from(arguments)) })
|
|
|
+*/
|
|
|
+
|
|
|
+bot.login('NTA5NzMzOTczNjQ0Mjc5ODE4.DsSLOw.AeKUx4C-ceWxHYjf1tbephaRDxw')
|
|
|
+
|
|
|
+module.exports = bot
|