diff options
| author | 8cy <[email protected]> | 2020-04-30 15:46:16 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-30 15:46:16 -0700 |
| commit | 3a4deac89054021b56ad5bd8005b2044cc085c98 (patch) | |
| tree | 3dd6af8503e497e46180b6b5231674f36bdce9f2 /bot.js | |
| download | uppity-3a4deac89054021b56ad5bd8005b2044cc085c98.tar.xz uppity-3a4deac89054021b56ad5bd8005b2044cc085c98.zip | |
Up, up, uppity.
Diffstat (limited to 'bot.js')
| -rw-r--r-- | bot.js | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -0,0 +1,36 @@ +const Discord = require('discord.js'); +const WS = require('./ws/ws.js'); +const client = new Discord.Client(); +const prefix = 'uppity!'; +var ws = new WS('1337', process.env.PORT, client); + +client.once('ready', () => { + console.log(`Started bot: ${client.user.tag} (ID: ${client.user.id})\nCurrently running on ${client.guilds.cache.size} server(s).`); + client.user.setActivity('@uwufier#7995', { + type: 'WATCHING' + }); +}); + +client.on('error', console.error); + +client.on('message', msg => { + function prefixCheck() { if (msg.content.startsWith(prefix)) return true; } + if (prefixCheck()) { + console.log(msg.member.user.tag, 'says', msg.content.toLowerCase(), 'in #' + msg.channel.name); + var args = msg.content.slice(prefix.length).split(/ +/); + var cmd = args.shift().toLowerCase(); + } + + if (cmd == 'status' || cmd == 's') { + let status = msg.guild.member('699473263998271489').presence.status; + if (status === 'online') { + let statusEnd = 'online'; + return msg.reply('<@699473263998271489> is **online**.'); + } else { + let statusEnd = 'offline'; + return msg.reply('<@699473263998271489> is **offline**.'); + } + } +}); + +client.login('NzA1NTM3MTA0MzM5NDAyODE1.XqtJCg.T4knAU8cyoCN37nHyE1G3vQvLB8');
\ No newline at end of file |