summaryrefslogtreecommitdiff
path: root/src/commands/user
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/user')
-rw-r--r--src/commands/user/age.ts12
-rw-r--r--src/commands/user/id.ts12
-rw-r--r--src/commands/user/nickname.ts9
-rw-r--r--src/commands/user/nitro.ts7
4 files changed, 22 insertions, 18 deletions
diff --git a/src/commands/user/age.ts b/src/commands/user/age.ts
index f541d67..13ead86 100644
--- a/src/commands/user/age.ts
+++ b/src/commands/user/age.ts
@@ -1,10 +1,12 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
+import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando';
+//@ts-ignore no types
import emoji from 'emoji-random'
import { formatDistance, formatRelative } from 'date-fns'
+//@ts-ignore no types
import { stripIndents } from 'common-tags'
module.exports = class AgeUser extends Command {
- constructor(client) {
+ constructor(client: CommandoClient) {
super(client, {
name: 'age',
aliases: [
@@ -31,10 +33,10 @@ module.exports = class AgeUser extends Command {
]
});
}
- async run(msg: CommandoMessage, { uUser }) {
+ async run(msg: CommandoMessage, { uUser }: any) {
const target = uUser || msg.author
const { createdAt } = target
- msg.reply(stripIndents`${formatDistance(createdAt, new Date())} old.
- Created on ${formatRelative(createdAt, new Date())}`)
+ return msg.reply(stripIndents`${formatDistance(createdAt, new Date())} old.
+ Created on ${formatRelative(createdAt, new Date())} ${emoji.random()}`)
}
}; \ No newline at end of file
diff --git a/src/commands/user/id.ts b/src/commands/user/id.ts
index b5d9060..a4d974d 100644
--- a/src/commands/user/id.ts
+++ b/src/commands/user/id.ts
@@ -1,9 +1,9 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
+import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando';
+//@ts-ignore no types
import emoji from 'emoji-random';
-import { MessageEmbed } from 'discord.js';
module.exports = class IDUser extends Command {
- constructor(client) {
+ constructor(client: CommandoClient) {
super(client, {
name: 'id',
group: 'user',
@@ -21,12 +21,12 @@ module.exports = class IDUser extends Command {
key: 'uUser',
prompt: 'Which user would you like to get the ID of?',
type: 'user',
- default: msg => msg.author
+ default: (msg: { author: any; }) => msg.author
}
]
});
}
- run(msg: CommandoMessage, { uUser }) {
- msg.reply(`**${uUser.id === msg.author.id ? 'Your' : `${uUser.username}'s`}** ID is **${uUser.id}**. ${emoji.random()}`)
+ run(msg: CommandoMessage, { uUser }: any) {
+ return msg.reply(`**${uUser.id === msg.author.id ? 'Your' : `${uUser.username}'s`}** ID is **${uUser.id}**. ${emoji.random()}`)
}
}; \ No newline at end of file
diff --git a/src/commands/user/nickname.ts b/src/commands/user/nickname.ts
index 3833f68..43c46cc 100644
--- a/src/commands/user/nickname.ts
+++ b/src/commands/user/nickname.ts
@@ -1,8 +1,9 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
+import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando';
+//@ts-ignore no types
import emoji from 'emoji-random';
module.exports = class NickNameUser extends Command {
- constructor(client) {
+ constructor(client: CommandoClient) {
super(client, {
name: 'nickname',
aliases: ['nick', 'name'],
@@ -28,8 +29,8 @@ module.exports = class NickNameUser extends Command {
guildOnly: true
});
}
- run(msg: CommandoMessage, { userNick }) {
+ run(msg: CommandoMessage, { userNick }: any) {
msg.member.setNickname(userNick)
- msg.reply(`Your nickname has been changed to ${userNick}. ` + emoji.random())
+ return msg.reply(`Your nickname has been changed to ${userNick}. ` + emoji.random())
}
}; \ No newline at end of file
diff --git a/src/commands/user/nitro.ts b/src/commands/user/nitro.ts
index 1302a0a..a54eb38 100644
--- a/src/commands/user/nitro.ts
+++ b/src/commands/user/nitro.ts
@@ -1,9 +1,10 @@
-import { Command, CommandoMessage } from 'discord.js-commando';
+import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando';
import { MessageEmbed } from 'discord.js';
+//@ts-ignore no types
import { stripIndents } from 'common-tags'
module.exports = class NitroUser extends Command {
- constructor(client) {
+ constructor(client: CommandoClient) {
super(client, {
name: 'nitro',
group: 'user',
@@ -25,6 +26,6 @@ module.exports = class NitroUser extends Command {
.setDescription(stripIndents`
This message can only be viewed by users with Discord Nitro.
[Lift off with Discord Nitro today](https://discordapp.com/nitro)`)
- msg.say(emb)
+ return msg.say(emb)
}
}; \ No newline at end of file