summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author8cy <[email protected]>2020-05-07 14:53:02 -0700
committer8cy <[email protected]>2020-05-07 14:53:02 -0700
commitd39052e139057b8303d79bb4192f677879797c92 (patch)
tree650c50f569f19f114be01ebe3dbf0aabfd6b54bc
parentremove this bc this is unused and outdated (diff)
downloaddep-core-d39052e139057b8303d79bb4192f677879797c92.tar.xz
dep-core-d39052e139057b8303d79bb4192f677879797c92.zip
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
-rw-r--r--src/app.ts4
-rw-r--r--src/bot.ts9
-rw-r--r--src/commands/bot/test.ts23
-rw-r--r--src/commands/crypto/btc.ts5
-rw-r--r--src/commands/crypto/btcchange.ts3
-rw-r--r--src/commands/utility/fortnitestats.ts3
-rw-r--r--src/commands/voice/join.ts23
-rw-r--r--src/commands/zerotwo/zerotwo.ts26
8 files changed, 90 insertions, 6 deletions
diff --git a/src/app.ts b/src/app.ts
index c7ca081..679c872 100644
--- a/src/app.ts
+++ b/src/app.ts
@@ -1,7 +1,7 @@
import { ShardingManager } from 'discord.js';
import config from './config.json';
-const manager = new ShardingManager('./dist/bot.js', { token: config['secret'] });
-//const manager = new ShardingManager('./bot.js', { token: config['secret'] });
+//const manager = new ShardingManager('./dist/bot.js', { token: config['secret'] });
+const manager = new ShardingManager('./bot.js', { token: config['secret'] });
manager.spawn();
console.log('\x1b[0m' + 'Connecting...');
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 <prefix>`. 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}**.`)
}
}
diff --git a/src/commands/bot/test.ts b/src/commands/bot/test.ts
new file mode 100644
index 0000000..8140c6e
--- /dev/null
+++ b/src/commands/bot/test.ts
@@ -0,0 +1,23 @@
+import { Command, CommandoMessage } from 'discord.js-commando';
+import emoji from 'emoji-random';
+
+module.exports = class TestBot extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'test',
+ group: 'bot',
+ memberName: 'test',
+ description: 'Do not test in production!',
+ examples: ['uwu!test'],
+ userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ throttling: {
+ usages: 5,
+ duration: 30
+ }
+ });
+ }
+ run(msg: CommandoMessage) {
+ msg.reply(`Do not test in production! ${emoji.random()}`)
+ }
+}; \ No newline at end of file
diff --git a/src/commands/crypto/btc.ts b/src/commands/crypto/btc.ts
index 5fd5f67..596b9e4 100644
--- a/src/commands/crypto/btc.ts
+++ b/src/commands/crypto/btc.ts
@@ -15,7 +15,8 @@ module.exports = class BTCCrypto extends Command {
{
key: 'currencyName',
prompt: 'What currency could you like to see it in? (USD, AUD, CAD, etc.)',
- type: 'string'
+ type: 'string',
+ default: 'USD'
}
],
examples: [
@@ -34,7 +35,7 @@ module.exports = class BTCCrypto extends Command {
run(msg: CommandoMessage, { currencyName }) {
currencyName = currencyName.toUpperCase();
btc({ isDecimal: true, currencyCode: currencyName }).then(value => {
- msg.reply('The current price of *Bitcoin* in **' + currencyName + '** is **' + value + '**. ' + emoji.random());
+ msg.reply(`The current price of *Bitcoin* is **${value} ${currencyName}**. ${emoji.random()}`);
});
}
}; \ No newline at end of file
diff --git a/src/commands/crypto/btcchange.ts b/src/commands/crypto/btcchange.ts
index 4218c31..f0b05b0 100644
--- a/src/commands/crypto/btcchange.ts
+++ b/src/commands/crypto/btcchange.ts
@@ -15,7 +15,8 @@ module.exports = class BTCChangeCrypto extends Command {
{
key: 'timeAmount',
prompt: 'What time range do you want to check the fluction amount in? (day, hour, week)',
- type: 'string'
+ type: 'string',
+ default: 'USD'
}
],
throttling: {
diff --git a/src/commands/utility/fortnitestats.ts b/src/commands/utility/fortnitestats.ts
index 84e0115..01f1f99 100644
--- a/src/commands/utility/fortnitestats.ts
+++ b/src/commands/utility/fortnitestats.ts
@@ -18,7 +18,8 @@ module.exports = class FortniteStatsUtility extends Command {
'fnstatistics',
'fn-statistics',
'fns',
- 'fn-s'
+ 'fn-s',
+ 'fortnite'
],
group: 'utility',
memberName: 'fortnitestats',
diff --git a/src/commands/voice/join.ts b/src/commands/voice/join.ts
new file mode 100644
index 0000000..07e00db
--- /dev/null
+++ b/src/commands/voice/join.ts
@@ -0,0 +1,23 @@
+import { Command, CommandoMessage } from 'discord.js-commando';
+import emoji from 'emoji-random';
+
+module.exports = class JoinVoice extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'join',
+ group: 'voice',
+ memberName: 'join',
+ description: 'Tells uwufier to join your voice channel.',
+ examples: ['uwu!join'],
+ userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ throttling: {
+ usages: 5,
+ duration: 30
+ }
+ });
+ }
+ run(msg: CommandoMessage) {
+ msg.reply(`\`uwu!join\` has been depricated in favour of a simpler user expirience. Uwufier will now join your channel whenever you request to play something with \`uwu!play\`! ${emoji.random()}`)
+ }
+}; \ No newline at end of file
diff --git a/src/commands/zerotwo/zerotwo.ts b/src/commands/zerotwo/zerotwo.ts
new file mode 100644
index 0000000..84a465d
--- /dev/null
+++ b/src/commands/zerotwo/zerotwo.ts
@@ -0,0 +1,26 @@
+import { Command, CommandoMessage } from 'discord.js-commando';
+// @ts-ignore no types
+import emoji from 'emoji-random';
+
+module.exports = class ZeroTwoZeroTwo extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'zerotwo',
+ group: 'zerotwo',
+ memberName: 'zerotwo',
+ description: 'Zero Two.',
+ examples: [
+ 'uwu!zerotwo'
+ ],
+ userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ throttling: {
+ usages: 5,
+ duration: 30
+ },
+ });
+ }
+ run(msg: CommandoMessage) {
+ msg.reply(`Zero Two is the best waifu of all, literally no one else can compare. Unironically she is the best waifu of all time. Literally praise her. This is not a joke she is literally the best. ${emoji.random()}`)
+ }
+}; \ No newline at end of file