From bdd8081327cf7fe8b37ff083257cf67cebd72c9c Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Tue, 4 Jul 2023 15:56:47 +1000 Subject: [PATCH] I hate struggling... *shivers* --- src/commands/dev.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/commands/dev.ts b/src/commands/dev.ts index 6ba95ec..6a2fe79 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -126,7 +126,8 @@ export default { if (err) i.edit(`\`\`\`${removeUsername(err.message)}\`\`\``) else i.edit(`Successfully compiled TypeScript files into JavaScript!\nUptime before restarting: **${client.formatTime(client.uptime as number, 3, {commas: true, longNames: true})}**`).then(()=>exec('pm2 restart Daggerbot')) }) - } + }, + file: ()=>interaction.reply({files:[`./src/database/${interaction.options.getString('name')}.json`]}).catch(()=>'Filesize is too large, upload cancelled.') } as any)[interaction.options.getSubcommand()](); }, data: new Discord.SlashCommandBuilder() @@ -183,4 +184,11 @@ export default { {name: 'Do Not Distrub', value: Discord.PresenceUpdateStatus.DoNotDisturb}, {name: 'Invisible', value: Discord.PresenceUpdateStatus.Offline} ))) + .addSubcommand(x=>x + .setName('file') + .setDescription('Send a JSON file from database directory on the host') + .addStringOption(x=>x + .setName('name') + .setDescription('JSON filename, don\'t include an extension') + .setRequired(true))) }