Skip to content

Commit

Permalink
move backup request
Browse files Browse the repository at this point in the history
  • Loading branch information
CKY- committed Dec 9, 2024
1 parent 71fc69c commit e49c3b4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 19 deletions.
37 changes: 37 additions & 0 deletions src/interactions/commands/handlers/backup-request.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { EmbedBuilder, SlashCommandBuilder, userMention } from 'discord.js';
import { CommandType, ICommandHandler } from '../command-handler.interface';
import { replaceVariables } from '../../../helpers/variable-replacer';
function getBaseEmbed() {
return new EmbedBuilder().setColor('#FFBE00');
}
const config = new SlashCommandBuilder()
.setName('Backup Request')
.setDescription('Request a users backup')
.setDefaultMemberPermissions(0);

export const saySlashCommand: ICommandHandler = {
type: CommandType.SlashCommand,
config,
async onTrigger(interaction) {
await interaction.deferReply();

const message = {
content: 'Please send us your latest backup zip',
embeds: [
getBaseEmbed().setTitle('How to send a backup').setDescription(`
- Open Firebot and go to **Settings** > **Backup**
- Press **Backup Now**
- Next, go to **Manage Backups** > **Open Backups Folder**
- DM {user} the latest **backup.zip** in that folder
`),
],
};


const variableMap = {
['{user}']: userMention(interaction.user.id),
};

await interaction.editReply(replaceVariables(variableMap, message));
},
};
1 change: 0 additions & 1 deletion src/interactions/commands/handlers/info/info-slash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { replaceVariables } from '../../../../helpers/variable-replacer';
const config = new SlashCommandBuilder()
.setName('info')
.setDescription('Firebot info')
.setDefaultMemberPermissions(0)
.addStringOption((option) =>
option
.setName('subject')
Expand Down
20 changes: 2 additions & 18 deletions src/interactions/commands/handlers/info/info-subjects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,6 @@ To locate your Firebot install logs:
Look for a file named \`SquirrelSetup.log\`. If you don't see it in the first location, try the second.
Once you've located the file, please upload it to this thread.
`),
],
},
},
{
name: 'Backup Request',
message: {
content: 'Please send us your latest backup zip',
embeds: [
getBaseEmbed().setTitle('How to send a backup').setDescription(`
- Open Firebot and go to **Settings** > **Backup**
- Press **Backup Now**
- Next, go to **Manage Backups** > **Open Backups Folder**
- DM {user} the latest **backup.zip** in that folder
`),
],
},
Expand All @@ -96,8 +82,7 @@ Once you've located the file, please upload it to this thread.
message: {
embeds: [
getBaseEmbed()
.setTitle('Nightly Builds')
.setDescription(
.setTitle('Nightly Builds').setDescription(
`You can find more information about the Nightly builds [here](https://discord.com/channels/372817064034959370/372821213443129346/973669737877889094).`
),
],
Expand All @@ -108,8 +93,7 @@ Once you've located the file, please upload it to this thread.
message: {
content: 'Please post your latest Firebot log file',
embeds: [
getBaseEmbed().setTitle('How to locate your Logs folder')
.setDescription(`
getBaseEmbed().setTitle('How to locate your Logs folder').setDescription(`
1. In Firebot, go to **File** > **Open Logs Folder**
- or -
2. Press **Win + R**, paste \`%appdata%\\Firebot\\v5\\logs\\\` into the field, and click **OK**.
Expand Down

0 comments on commit e49c3b4

Please sign in to comment.