1 |
import { exit } from "process"; |
import { exit } from "process"; |
2 |
import DiscordClient from "../../client/Client"; |
import DiscordClient from "../../client/Client"; |
|
import BannedGuild from "../../models/BannedGuild"; |
|
3 |
import BaseCLICommand from "../../utils/structures/BaseCLICommand"; |
import BaseCLICommand from "../../utils/structures/BaseCLICommand"; |
4 |
|
|
5 |
export default class BanGuildCommand extends BaseCLICommand { |
export default class GuildLeaveCommand extends BaseCLICommand { |
6 |
requiredArgs = 1; |
requiredArgs = 1; |
7 |
|
|
8 |
constructor() { |
constructor() { |
9 |
super('banguild', 'guild'); |
super('guildleave', 'guild'); |
10 |
} |
} |
11 |
|
|
12 |
async run(client: DiscordClient, argv: string[], args: string[]) { |
async run(client: DiscordClient, argv: string[], args: string[]) { |
23 |
exit(-1); |
exit(-1); |
24 |
} |
} |
25 |
|
|
|
await BannedGuild.create({ |
|
|
guild_id, |
|
|
reason |
|
|
}); |
|
|
|
|
26 |
await guild.leave(); |
await guild.leave(); |
27 |
|
|
28 |
console.log(`Succesfully banned and left guild: ${guild.name} (${guild.id})`); |
console.log(`Succesfully left guild: ${guild.name} (${guild.id})`); |
29 |
|
|
30 |
await exit(0); |
await exit(0); |
31 |
} |
} |