import { SlashCommand, SlashCreator, CommandContext, CommandOptionType } from 'slash-create'; import { Client } from 'discord.js' const valid = ['498992803532242945', '435206857276260353'] export default class PingCommand extends SlashCommand { constructor(creator: SlashCreator) { super(creator, { name: 'andrewkuo', description: 'give andrewkuo role', options: [ { name: 'who', description: 'who', type: CommandOptionType.USER, required: true } ] }) } async run(ctx: CommandContext) { if (valid.indexOf(ctx.user.id) == -1) { return 'no' } const cli = this.client as Client const g = cli.guilds.cache.get(ctx.guildID) const me = g.members.cache.get(ctx.options.who as string) await me.roles.add('1148804439755460638', '/andrewkuo') return `gave andrewkuo role to @${me.user.username}` } }