From 71fc69c5a406c1902719553cd520ae59ddb673b4 Mon Sep 17 00:00:00 2001 From: CKY- Date: Mon, 9 Dec 2024 13:16:18 -0700 Subject: [PATCH 1/3] add the rest of the commands --- .../commands/handlers/info/info-subjects.ts | 253 +++++++++++++----- 1 file changed, 187 insertions(+), 66 deletions(-) diff --git a/src/interactions/commands/handlers/info/info-subjects.ts b/src/interactions/commands/handlers/info/info-subjects.ts index a58efcb..9efa533 100644 --- a/src/interactions/commands/handlers/info/info-subjects.ts +++ b/src/interactions/commands/handlers/info/info-subjects.ts @@ -8,11 +8,11 @@ export const infoSubjects: Array<{ name: string; message: BaseMessageOptions; }> = [ - { - name: 'Off Screen', - message: { - embeds: [ - getBaseEmbed().setDescription(` + { + name: 'Off Screen', + message: { + embeds: [ + getBaseEmbed().setDescription(` If Firebot is opening off-screen or behaving oddly, follow these steps to reset its window position: 1. Close Firebot. @@ -22,14 +22,14 @@ If Firebot is opening off-screen or behaving oddly, follow these steps to reset This will reset Firebot's window position. Reopen Firebot, and it should appear correctly. `), - ], + ], + }, }, - }, - { - name: 'OBS Troubleshooting', - message: { - embeds: [ - getBaseEmbed().setTitle('OBS Troubleshooting').setDescription(` + { + name: 'OBS Troubleshooting', + message: { + embeds: [ + getBaseEmbed().setTitle('OBS Troubleshooting').setDescription(` If you're experiencing issues with the OBS integration, follow these steps to troubleshoot: 1. **Remove the OBS WebSocket Script in Firebot, if present** @@ -54,16 +54,16 @@ If you're experiencing issues with the OBS integration, follow these steps to tr - If yes, set the address to \`127.0.0.1\` or \`localhost\`. - If no, ensure you're using the correct IP address of the PC running OBS. `), - ], + ], + }, }, - }, - { - name: 'Install Log', - message: { - content: - 'To help us assist you more effectively, please provide your install log.', - embeds: [ - getBaseEmbed().setTitle('Instal Logs').setDescription(` + { + name: 'Install Log', + message: { + content: + 'To help us assist you more effectively, please provide your install log.', + embeds: [ + getBaseEmbed().setTitle('Instal Logs').setDescription(` To locate your Firebot install logs: 1. Press **Win + R** to open the Run dialog. 2. Enter one of the following paths and press Enter: @@ -74,54 +74,54 @@ Look for a file named \`SquirrelSetup.log\`. If you don't see it in the first lo 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(` + { + 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 `), - ], + ], + }, }, - }, - { - name: 'Nightly Builds', - message: { - embeds: [ - getBaseEmbed() - .setTitle('Nightly Builds') - .setDescription( - `You can find more information about the Nightly builds [here](https://discord.com/channels/372817064034959370/372821213443129346/973669737877889094).` - ), - ], + { + name: 'Nightly Builds', + message: { + embeds: [ + getBaseEmbed() + .setTitle('Nightly Builds') + .setDescription( + `You can find more information about the Nightly builds [here](https://discord.com/channels/372817064034959370/372821213443129346/973669737877889094).` + ), + ], + }, }, - }, - { - name: 'Firebot Logs', - message: { - content: 'Please post your latest Firebot log file', - embeds: [ - getBaseEmbed().setTitle('How to locate your Logs folder') - .setDescription(` + { + name: 'Firebot Logs', + message: { + content: 'Please post your latest Firebot log file', + embeds: [ + 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**. `), - ], + ], + }, }, - }, - { - name: 'Cloud Backups', - message: { - embeds: [ - getBaseEmbed().setTitle('Cloud Backups').setDescription(` + { + name: 'Cloud Backups', + message: { + embeds: [ + getBaseEmbed().setTitle('Cloud Backups').setDescription(` If you use OneDrive to back up your documents, you can include the Firebot data folder in your OneDrive backups by creating a symbolic link. Follow these steps: 1. Open a Command Prompt window. @@ -131,14 +131,14 @@ If you use OneDrive to back up your documents, you can include the Firebot data This command creates a symbolic link between your Firebot V5 data folder (where all your bot profiles and settings are stored) and a folder in your OneDrive. This ensures that OneDrive automatically backs up your Firebot data whenever changes are made. `), - ], + ], + }, }, - }, - { - name: 'Auth Issues', - message: { - embeds: [ - getBaseEmbed().setTitle('Auth Issues').setDescription(` + { + name: 'Auth Issues', + message: { + embeds: [ + getBaseEmbed().setTitle('Auth Issues').setDescription(` If you're experiencing issues with Firebot hanging on start up or failing to connect to Twitch, follow these steps to troubleshoot: 1. **Check Your Antivirus Software** @@ -156,7 +156,128 @@ If you're experiencing issues with Firebot hanging on start up or failing to con - Delete the file named \`auth-twitch.json\`. - Restart Firebot and log in again. `), - ], + ], + }, }, - }, -]; + { + name: 'Manual Restore', + message: { + embeds: [ + getBaseEmbed().setTitle('Manual Restore').setDescription(` +If you are having issues with the automatic restore process within Firebot, you can manually restore a backup with the following steps. +## Manual Restore Steps for V5 +1. Make sure you have the backup .zip file that you want to restore from handy + - The file name will look something like \`backup_1583810006278_v5.8.0.zip\` + - You can find backups zips from within Firebot via **Settings > Backup > Manage Backups > Open Backups Folder** + - Or via the Run app (Win key + R) and paste in \`%appdata%\\Firebot\\v5\\backups\\\` +2. Close down Firebot +3. Open the Run app (Win key + R) and paste in \`%appdata%\\Firebot\\v5\\\`, then click OK. +4. In the file browser window that appears, DELETE the **profiles** folder and the **global-settings** file. +5. Extract the contents of the backup zip from Step 1 into this folder to replace the just deleted **profiles** folder and **global-settings** file. +6. Start Firebot. +`), + ], + }, + }, + { + name: 'Guides and Tutorials', + message: { + content: "Guides and Tutorials by the community", + embeds: [ + getBaseEmbed().setTitle('Guides and Tutorials').setDescription(` +Hi, here you can see a short list of guides and tutorials made by the community for Firebot: + +A YouTube Firebot tutorial playlist by heyaapl: +https://www.youtube.com/playlist?list=PL4AUBPu8fw6jfzEvd-GYw357uSNJBt53E + +A written guide by Tío on Google Drive: +https://drive.google.com/drive/folders/1jQzl-kfIdeMTlo6yC7gUxWtyBtSDKYpI + +If you have made one or know of anyone else that have made something like this for Firebot please tell us so that we can add it to this list and to our Getting Started page over of the Firebot Github Wiki: +https://github.com/crowbartools/Firebot/wiki/Getting-Started +`), + ], + }, + }, + { + name: 'Fresh Install', + message: { + embeds: [ + getBaseEmbed().setTitle('Fresh Install').setDescription(` +To perform a fresh install: +1: Exit Firebot +2: Copy the contents of %appdata%\\firebot\\v5\\ somewhere else (as a back up) +3: Delete %appdata%\\firebot +4: Delete %localappdata%\\firebotv5 and/or %localappdata%\\firebot +5: Download latest version: https://firebot.app/ +6: Run the installer +`), + ], + }, + }, + { + name: 'Bit Defender', + message: { + embeds: [ + getBaseEmbed().setTitle('Bit Defender').setDescription(` +How to exclude applications in Bitdefender: +- [bitdefender.com](https://www.bitdefender.com/business/support/en/77212-342964-general.html#UUID-7a762905-3544-7885-d4f5-7110909909d5_N1667164575537 +Here you can report false positives: +- https://www.bitdefender.com/submit/ +`), + ], + }, + }, + { + name: 'But Another Bot Does It', + message: { + embeds: [ + getBaseEmbed().setTitle('But Another Bot Does It?').setDescription(` +Just a friendly reminder, just because Software A supports something, that doesn't mean that Software B is required to support it. +Things you want won't always appear in the software you use. +This is true in all walks of computer life and why there are so many tools that do the same thing. +`), + ], + }, + }, + { + name: 'Discord Mentions', + message: { + embeds: [ + getBaseEmbed().setTitle('Discord Mentions').setDescription(` +With developer mode enabled in Discord, go to the Roles section in your Discord server settings, tap on the three-dot menu next to the role you want to mention, then Copy ID. +Then use \`<@&roleid>\` in the message (e.g. \`<@&9471923849123483>\`). +`), + ], + }, + }, + { + name: 'Firebot Expert', + message: { + embeds: [ + getBaseEmbed().setTitle('Firebot Expert Role').setDescription(` +**What is It** +The Firebot Expert role acknowledges members of the community that have shown over time through their own initiative and merit to be insightful and helpful when it comes to user questions. + +It serves to denote for other users that the individual is speaking from extensive knowledge and experience of Firebot's usage. The individual's advice/support should be weighted more heavily than that of normal users. However, this does not mean the user speaks from authority or for the Firebot dev team. + + +**How To Get It** +The Firebot Expert role is earned by an individual through a consistent showing of knowledge in regards to Firebot and a willingness to apply that knowledge via offering support to user questions. The individual must also have a positive impact on the community. + +We do not accept applications, referrals or requests in regards to the role. Nor is there a set of criteria that must be met for the individual to receive the role. When a member of the dev team notices a user they deem fit for the role, that member will bring the user up to the other dev members and the role is given if a consensus is met. +`), + ], + }, + }, + { + name: 'Data Folder', + message: { + embeds: [ + getBaseEmbed().setTitle('Data Folder').setDescription(` +You can get to Firebot's data folder via File > Open Data Folder or by pressing "Win + R" and pasting: \`%appdata%\\firebot\\v5\\\` +`), + ], + }, + }, + ]; From e49c3b44519c8cd7dc3d732238162e0c425fb5d3 Mon Sep 17 00:00:00 2001 From: CKY- Date: Mon, 9 Dec 2024 13:37:33 -0700 Subject: [PATCH 2/3] move backup request --- .../commands/handlers/backup-request.ts | 37 +++++++++++++++++++ .../commands/handlers/info/info-slash.ts | 1 - .../commands/handlers/info/info-subjects.ts | 20 +--------- 3 files changed, 39 insertions(+), 19 deletions(-) create mode 100644 src/interactions/commands/handlers/backup-request.ts diff --git a/src/interactions/commands/handlers/backup-request.ts b/src/interactions/commands/handlers/backup-request.ts new file mode 100644 index 0000000..ae9543d --- /dev/null +++ b/src/interactions/commands/handlers/backup-request.ts @@ -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)); + }, +}; diff --git a/src/interactions/commands/handlers/info/info-slash.ts b/src/interactions/commands/handlers/info/info-slash.ts index b2a120c..77bfd6f 100644 --- a/src/interactions/commands/handlers/info/info-slash.ts +++ b/src/interactions/commands/handlers/info/info-slash.ts @@ -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') diff --git a/src/interactions/commands/handlers/info/info-subjects.ts b/src/interactions/commands/handlers/info/info-subjects.ts index 9efa533..c14037d 100644 --- a/src/interactions/commands/handlers/info/info-subjects.ts +++ b/src/interactions/commands/handlers/info/info-subjects.ts @@ -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 `), ], }, @@ -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).` ), ], @@ -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**. From f58b29524394e961ee9639470679cf57fa6da989 Mon Sep 17 00:00:00 2001 From: CKY- Date: Mon, 9 Dec 2024 13:57:36 -0700 Subject: [PATCH 3/3] add command to manager --- src/interactions/commands/command-manager.ts | 2 ++ src/interactions/commands/handlers/backup-request.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/interactions/commands/command-manager.ts b/src/interactions/commands/command-manager.ts index 818e306..15ff8f0 100644 --- a/src/interactions/commands/command-manager.ts +++ b/src/interactions/commands/command-manager.ts @@ -20,6 +20,7 @@ import { sendToIssuesContextMenuCommand } from './handlers/send-to-issues-contex import { randomFeaturedSlashCommand } from './handlers/random-featured-slash'; import { docsSlashCommand } from './handlers/docs/docs-slash'; import { infoSlashCommand } from './handlers/info/info-slash'; +import { backupRequestCommand } from './handlers/backup-request'; class CommandManager implements IInteractionManager { private handlers: ICommandHandler[] = []; @@ -42,6 +43,7 @@ class CommandManager implements IInteractionManager { randomFeaturedSlashCommand, docsSlashCommand, infoSlashCommand, + backupRequestCommand, ]; for (const handler of commandsToRegister) { diff --git a/src/interactions/commands/handlers/backup-request.ts b/src/interactions/commands/handlers/backup-request.ts index ae9543d..2f5e7ea 100644 --- a/src/interactions/commands/handlers/backup-request.ts +++ b/src/interactions/commands/handlers/backup-request.ts @@ -9,7 +9,7 @@ const config = new SlashCommandBuilder() .setDescription('Request a users backup') .setDefaultMemberPermissions(0); -export const saySlashCommand: ICommandHandler = { +export const backupRequestCommand: ICommandHandler = { type: CommandType.SlashCommand, config, async onTrigger(interaction) {