-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters