From d39052e139057b8303d79bb4192f677879797c92 Mon Sep 17 00:00:00 2001 From: 8cy <50817549+8cy@users.noreply.github.com> Date: Thu, 7 May 2020 14:53:02 -0700 Subject: add cmd logging and join server logging to support server - add depreciated join cmd *lol* - fix some formatting in btc and add defaults - add zero two cmd - add fortnite alias to fortnitestats --- src/bot.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/bot.ts') diff --git a/src/bot.ts b/src/bot.ts index bfd2ea2..452df4f 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -1,5 +1,6 @@ import config from './config.json'; import { CommandoClient } from 'discord.js-commando'; +// @ts-ignore no default import import WS from './server'; import Welcome from './models/welcome.js'; import Goodbye from './models/goodbye.js'; @@ -82,9 +83,13 @@ client.on('warn', console.warn) client.on('guildCreate', guild => { console.log(`Joined server: ${guild.name}`) guild.owner?.send('Hi! Thank you for inviting my bot to your server! To view the complete list of commands, do `uwu!help`. If you\'d like, you can also change the prefix using `uwu!prefix change `. If you want to contact the lead developer for possible suggestions or to report a bug, please join the support server: https://crack.cf/uwufier-support. ' + emoji.random()) + //@ts-ignore + client.guilds.cache.get('704032355987488791')?.channels.cache.get('706818034999754792')?.send(`Joined server: **${guild.name}**.`) }) client.on('guildDelete', guild => { console.log(`Left server: ${guild.name}`) + //@ts-ignore + client.guilds.cache.get('704032355987488791')?.channels.cache.get('706818034999754792')?.send(`Joined server: **${guild.name}**.`) }) client.on('guildMemberAdd', member => { @@ -126,8 +131,12 @@ client.on('message', async msg => { if (prefixCheck()) { if (msg.channel.type == 'dm') { console.log(msg.author.tag, 'says', msgContent, 'in a DM'); + //@ts-ignore + client.guilds.cache.get('704032355987488791')?.channels.cache.get('706818034999754792')?.send(`**${msg.author.tag}** says **${msgContent}** in a **DM.**`) } else { console.log(msg.member?.user.tag, 'says', msgContent, 'in #' + msg.channel.name + ' in ' + msg.guild?.name); + //@ts-ignore + client.guilds.cache.get('704032355987488791')?.channels.cache.get('706818034999754792')?.send(`**${msg.author.tag}** says **${msgContent}** in **#${msg.channel.name}** in **${msg.guild?.name}**.`) } } -- cgit v1.2.3