summaryrefslogtreecommitdiff
path: root/src/bot.ts
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-28 13:16:40 -0700
committer8cy <[email protected]>2020-04-28 13:16:40 -0700
commitc6d45a94b0e3bbcb0b2e01ed8e35428040126c45 (patch)
tree526227612501768272e1f985d5f7c6b3671bf638 /src/bot.ts
parentchange darling quote calc method, add 002 quotes to quote, v8.1.2 (diff)
downloaddep-core-c6d45a94b0e3bbcb0b2e01ed8e35428040126c45.tar.xz
dep-core-c6d45a94b0e3bbcb0b2e01ed8e35428040126c45.zip
The Return, v8.2.0
- add goodbye - add avatar alias to pfp - add rule34, gelbooru and danbooru - fix ban and kick - add advice - add motivation alias to motivate
Diffstat (limited to 'src/bot.ts')
-rw-r--r--src/bot.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/bot.ts b/src/bot.ts
index 11af17a..5e949e9 100644
--- a/src/bot.ts
+++ b/src/bot.ts
@@ -2,6 +2,7 @@ import config from './config.json';
import { CommandoClient } from 'discord.js-commando';
//import WS from './ws/ws';
import Welcome from './models/welcome.js';
+import Goodbye from './models/goodbye.js';
import mongo from 'mongoose';
mongo.connect('mongodb://sin:[email protected]:47107/heroku_4qrjvmb9', { useNewUrlParser: true, useUnifiedTopology: true })
import path from 'path';
@@ -85,6 +86,19 @@ client.on('guildMemberAdd', member => {
}
})
})
+client.on('guildMemberRemove', member => {
+ Welcome.findOne({ guildID: member.guild.id }, async (error, guild) => {
+ if (error) {
+ console.log(error)
+ } else if (!guild) {
+ return
+ } else if (guild) {
+ member.guild.channels.cache.get(guild.channelID)?.send(`<@${member.id}> has joined **${member.guild.name}**! ` + emoji.random())
+ } else {
+ return
+ }
+ })
+})
client.on('message', async msg => {
var msgContent = msg.content.toLowerCase();