aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev/debug.ts
blob: f8c614d4bfb7b0ab7c079d61fd626ae2312d59a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// import { BushCommand, type ArgType, type BushMessage, type BushSlashMessage } from '#lib';
// import { ApplicationCommandOptionType, AutocompleteInteraction, ChatInputCommandInteraction } from 'discord.js';
// import Fuse from 'fuse.js';

// export default class DebugCommand extends BushCommand {
// 	public constructor() {
// 		super('debug', {
// 			aliases: ['debug'],
// 			category: 'debug',
// 			description: 'Command description.',
// 			usage: ['template <requiredArg> [optionalArg]'],
// 			examples: ['template 1 2'],
// 			args: [
// 				{
// 					id: 'action',
// 					description: 'Debug action.',
// 					type: 'string',
// 					prompt: 'Debug action.',
// 					retry: '{error} Pick valid action.',
// 					slashType: ApplicationCommandOptionType.String,
// 					autocomplete: true
// 				}
// 			],
// 			slash: true,
// 			slashGuilds: ['516977525906341928'],
// 			superUserOnly: true,
// 			clientPermissions: (m) => util.clientSendAndPermCheck(m),
// 			userPermissions: []
// 		});
// 	}

// 	public override async exec(message: BushMessage | BushSlashMessage, args: { action: ArgType<'string'> }) {
// 		if (args.action === 'util.reply') {
// 			return await message.util.reply(`This is a util.reply`);
// 		} else if (args.action === 'util.reply-object') {
// 			return await message.util.reply({
// 				content: `This is a util.reply with object parameters`,
// 				embeds: [{ description: 'And an embed' }]
// 			});
// 		} else if (args.action === 'util.send') {
// 			return await message.util.send(`This is a util.send`);
// 		} else if (args.action === 'util.send-object') {
// 			return await message.util.send({
// 				content: `This is a util.send with object parameters`,
// 				embeds: [{ description: 'And an embed' }]
// 			});
// 		} else if (args.action === 'interaction.reply') {
// 			return await (message.interaction as ChatInputCommandInteraction).reply(`This is a interaction.reply`);
// 		} else if (args.action === 'interaction.reply-object') {
// 			return await (message.interaction as ChatInputCommandInteraction).reply({
// 				content: `This is a interaction.reply with object parameters`,
// 				embeds: [{ description: 'And an embed' }]
// 			});
// 		} else {
// 			return await message.util.reply(`${util.emojis.error} Invalid action.`);
// 		}
// 	}

// 	public override autocomplete(interaction: AutocompleteInteraction) {
// 		const actions = [
// 			'util.reply',
// 			'util.reply-object',
// 			'util.send',
// 			'util.send-object',
// 			'interaction.reply',
// 			'interaction.reply-object'
// 		];

// 		const fuzzy = new Fuse(actions, {
// 			threshold: 0.5,
// 			isCaseSensitive: false,
// 			findAllMatches: true
// 		}).search(interaction.options.getFocused().toString());

// 		const res = fuzzy.slice(0, fuzzy.length >= 25 ? 25 : undefined).map((v) => ({ name: v.item, value: v.item }));

// 		void interaction.respond(res.length ? res : actions.map((v) => ({ name: v, value: v })));
// 	}
// }