harmony/test/cmds/mentions.ts

36 lines
1,011 B
TypeScript
Raw Normal View History

2021-04-04 05:52:47 +00:00
import { Command, CommandContext, Embed } from '../../mod.ts'
export default class PingCommand extends Command {
2020-12-02 12:29:52 +00:00
name = 'mentions'
aliases = ['m']
execute(ctx: CommandContext): void {
const embed = new Embed()
.setTitle('Mentions')
2020-12-02 12:29:52 +00:00
.addField(
'Users',
`${
ctx.message.mentions.users.size === 0 ? `None` : ''
}${ctx.message.mentions.users.map((u) => u.toString()).join(', ')}`
)
.addField(
'Channels',
`${
ctx.message.mentions.channels.size === 0 ? `None` : ''
}${ctx.message.mentions.channels.map((u) => u.toString()).join(', ')}`
)
.addField(
'Roles',
`${
ctx.message.mentions.roles.size === 0 ? `None` : ''
}${ctx.message.mentions.roles.map((u) => u.toString()).join(', ')}`
)
.addField(
'Everyone?',
ctx.message.mentions.everyone === true ? 'Yes' : 'No'
)
.setColor(0xff0000)
ctx.message.channel.send(embed)
}
2020-12-02 12:29:52 +00:00
}