summaryrefslogtreecommitdiff
path: root/src/commands/bot/ip.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/bot/ip.ts')
-rw-r--r--src/commands/bot/ip.ts38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/commands/bot/ip.ts b/src/commands/bot/ip.ts
new file mode 100644
index 0000000..c9c8ec0
--- /dev/null
+++ b/src/commands/bot/ip.ts
@@ -0,0 +1,38 @@
+import { Command, CommandoMessage } from 'discord.js-commando';
+import emoji from 'emoji-random';
+import { MessageEmbed } from 'discord.js';
+import request from 'node-superfetch'
+
+module.exports = class IPBot extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'ip',
+ group: 'bot',
+ memberName: 'ip',
+ description: 'Gives you the bot\'s ip.',
+ examples: ['uwu!ip'],
+ userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ throttling: {
+ usages: 5,
+ duration: 30
+ },
+ ownerOnly: true
+ });
+ }
+ async run(msg: CommandoMessage) {
+ let { body } = await request
+ .get('https://api.ipify.org')
+ .query({ format: 'json' })
+
+ msg.say('Please wait...').then(m => {
+ m.edit(`** **`);
+
+ let emb = new MessageEmbed()
+ .setDescription(`uwufier\'s current IP address is **${body.ip}**. ` + emoji.random())
+ .setColor(0xFFCC4D)
+
+ msg.say(emb);
+ });
+ }
+}; \ No newline at end of file