Skip to content

Commit 9888ecb

Browse files
authored
chore: split commands into files (#52)
1 parent 803a168 commit 9888ecb

18 files changed

+326
-263
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/interactions/commands/handlers/info/info-slash.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import { SlashCommandBuilder, userMention } from 'discord.js';
1+
import { EmbedBuilder, SlashCommandBuilder, userMention } from 'discord.js';
22
import { CommandType, ICommandHandler } from '../../command-handler.interface';
33
import { infoSubjects } from './info-subjects';
44
import { replaceVariables } from '../../../../helpers/variable-replacer';
55

6+
export function getBaseEmbed() {
7+
return new EmbedBuilder().setColor('#FFBE00');
8+
}
9+
610
const config = new SlashCommandBuilder()
711
.setName('info')
812
.setDescription('Firebot info')
Lines changed: 30 additions & 261 deletions
Original file line numberDiff line numberDiff line change
@@ -1,267 +1,36 @@
1-
import { BaseMessageOptions, EmbedBuilder } from "discord.js";
2-
3-
function getBaseEmbed() {
4-
return new EmbedBuilder().setColor('#FFBE00');
5-
}
1+
import { BaseMessageOptions } from "discord.js";
2+
3+
import { authIssues } from "./subjects/auth-issues";
4+
import { bitDefender } from "./subjects/bit-defender";
5+
import { butAnother } from "./subjects/but-another";
6+
import { cloudBackups } from "./subjects/cloud-backup";
7+
import { dataFolder } from "./subjects/data-folder";
8+
import { discordMentions } from "./subjects/discrod-mentions";
9+
import { expert } from "./subjects/expert";
10+
import { firebotLogs } from "./subjects/firebot-logs";
11+
import { instalLog } from "./subjects/install-log";
12+
import { manualRestore } from "./subjects/manual-restore";
13+
import { nightly } from "./subjects/nightly-builds";
14+
import { obsTroubleShooting } from "./subjects/obs-troubleshooting";
15+
import { offScreen } from "./subjects/offscreen";
16+
import { tuts } from "./subjects/tutorials";
617

718
export const infoSubjects: Array<{
819
name: string;
920
message: BaseMessageOptions;
1021
}> = [
11-
{
12-
name: 'Off Screen',
13-
message: {
14-
embeds: [
15-
getBaseEmbed().setDescription(`
16-
If Firebot is opening off-screen or behaving oddly, follow these steps to reset its window position:
17-
18-
1. Close Firebot.
19-
2. Press **Win + R** to open the Run dialog.
20-
3. Paste \`%appdata%\\Firebotv5\` into the box and press **Enter**.
21-
4. Delete the file: \`window-state.json\`.
22-
23-
This will reset Firebot's window position. Reopen Firebot, and it should appear correctly.
24-
`),
25-
],
26-
},
27-
},
28-
{
29-
name: 'OBS Troubleshooting',
30-
message: {
31-
embeds: [
32-
getBaseEmbed().setTitle('OBS Troubleshooting').setDescription(`
33-
If you're experiencing issues with the OBS integration, follow these steps to troubleshoot:
34-
35-
1. **Remove the OBS WebSocket Script in Firebot, if present**
36-
- Navigate to **Settings** > **Scripts** > **Manage Scripts** in Firebot.
37-
- Delete the \`OBS WebSockets\` script if you have it installed.
38-
39-
2. **Check OBS WebSocket Server Settings**
40-
- In OBS, go to **Tools** > **WebSocket Server Settings**.
41-
- Ensure the server is enabled.
42-
- Verify that:
43-
- You have set a password.
44-
- You know the port number (default is often 4455).
45-
46-
3. **Verify Firebot OBS Integration Settings**
47-
- In Firebot, navigate to **Settings** > **Integrations** > **OBS** > **Configure**
48-
- Ensure the following match the OBS WebSocket settings:
49-
- The **password**.
50-
- The **port**.
51-
52-
4. **Connection Details**
53-
- Are you running Firebot on the **same PC** as OBS?
54-
- If yes, set the address to \`127.0.0.1\` or \`localhost\`.
55-
- If no, ensure you're using the correct IP address of the PC running OBS.
56-
`),
57-
],
58-
},
59-
},
60-
{
61-
name: 'Install Log',
62-
message: {
63-
content:
64-
'To help us assist you more effectively, please provide your install log.',
65-
embeds: [
66-
getBaseEmbed().setTitle('Instal Logs').setDescription(`
67-
To locate your Firebot install logs:
68-
1. Press **Win + R** to open the Run dialog.
69-
2. Enter one of the following paths and press Enter:
70-
- \`%localappdata%\\Firebotv5\\\`
71-
- \`%localappdata%\\SquirrelTemp\\\`
72-
73-
Look for a file named \`SquirrelSetup.log\`. If you don't see it in the first location, try the second.
74-
75-
Once you've located the file, please upload it to this thread.
76-
`),
77-
],
78-
},
79-
},
80-
{
81-
name: 'Nightly Builds',
82-
message: {
83-
embeds: [
84-
getBaseEmbed()
85-
.setTitle('Nightly Builds').setDescription(
86-
`You can find more information about the Nightly builds [here](https://discord.com/channels/372817064034959370/372821213443129346/973669737877889094).`
87-
),
88-
],
89-
},
90-
},
91-
{
92-
name: 'Firebot Logs',
93-
message: {
94-
content: 'Please post your latest Firebot log file',
95-
embeds: [
96-
getBaseEmbed().setTitle('How to locate your Logs folder').setDescription(`
97-
1. In Firebot, go to **File** > **Open Logs Folder**
98-
- or -
99-
2. Press **Win + R**, paste \`%appdata%\\Firebot\\v5\\logs\\\` into the field, and click **OK**.
100-
`),
101-
],
102-
},
103-
},
104-
{
105-
name: 'Cloud Backups',
106-
message: {
107-
embeds: [
108-
getBaseEmbed().setTitle('Cloud Backups').setDescription(`
109-
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:
110-
111-
1. Open a Command Prompt window.
112-
2. Paste the following command and press **Enter**:
113-
\`mklink /j "%UserProfile%\\OneDrive\\FirebotData" "%appdata%\\Firebot\\v5"\`
114-
115-
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.
116-
117-
`),
118-
],
119-
},
120-
},
121-
{
122-
name: 'Auth Issues',
123-
message: {
124-
embeds: [
125-
getBaseEmbed().setTitle('Auth Issues').setDescription(`
126-
If you're experiencing issues with Firebot hanging on start up or failing to connect to Twitch, follow these steps to troubleshoot:
127-
128-
1. **Check Your Antivirus Software**
129-
- Verify that your antivirus software hasn't quarantined Firebot.
130-
131-
2. **Delete Saved Login File**
132-
If the issue persists, try deleting the file where Firebot saves login credentials:
133-
- Open your Firebot data folder via either of the following methods:
134-
- **A**:
135-
- In Firebot, go to **File** > **Open Data Folder**, then exit Firebot.
136-
- or **B**:
137-
- Press **Win + R** to open the Run dialog.
138-
- Paste \`%appdata%\\Firebot\\v5\\profiles\\\` into the field and press **Enter**.
139-
- Open your profile folder.
140-
- Delete the file named \`auth-twitch.json\`.
141-
- Restart Firebot and log in again.
142-
`),
143-
],
144-
},
145-
},
146-
{
147-
name: 'Manual Restore',
148-
message: {
149-
embeds: [
150-
getBaseEmbed().setTitle('Manual Restore').setDescription(`
151-
If you are having issues with the automatic restore process within Firebot, you can manually restore a backup with the following steps.
152-
## Manual Restore Steps for V5
153-
1. Make sure you have the backup .zip file that you want to restore from handy
154-
- The file name will look something like \`backup_1583810006278_v5.8.0.zip\`
155-
- You can find backups zips from within Firebot via **Settings > Backup > Manage Backups > Open Backups Folder**
156-
- Or via the Run app (Win key + R) and paste in \`%appdata%\\Firebot\\v5\\backups\\\`
157-
2. Close down Firebot
158-
3. Open the Run app (Win key + R) and paste in \`%appdata%\\Firebot\\v5\\\`, then click OK.
159-
4. In the file browser window that appears, DELETE the **profiles** folder and the **global-settings** file.
160-
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.
161-
6. Start Firebot.
162-
`),
163-
],
164-
},
165-
},
166-
{
167-
name: 'Guides and Tutorials',
168-
message: {
169-
content: "Guides and Tutorials by the community",
170-
embeds: [
171-
getBaseEmbed().setTitle('Guides and Tutorials').setDescription(`
172-
Hi, here you can see a short list of guides and tutorials made by the community for Firebot:
173-
174-
A YouTube Firebot tutorial playlist by heyaapl:
175-
https://www.youtube.com/playlist?list=PL4AUBPu8fw6jfzEvd-GYw357uSNJBt53E
176-
177-
A written guide by Tío on Google Drive:
178-
https://drive.google.com/drive/folders/1jQzl-kfIdeMTlo6yC7gUxWtyBtSDKYpI
179-
180-
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:
181-
https://github.com/crowbartools/Firebot/wiki/Getting-Started
182-
`),
183-
],
184-
},
185-
},
186-
{
187-
name: 'Fresh Install',
188-
message: {
189-
embeds: [
190-
getBaseEmbed().setTitle('Fresh Install').setDescription(`
191-
To perform a fresh install:
192-
1: Exit Firebot
193-
2: Copy the contents of %appdata%\\firebot\\v5\\ somewhere else (as a back up)
194-
3: Delete %appdata%\\firebot
195-
4: Delete %localappdata%\\firebotv5 and/or %localappdata%\\firebot
196-
5: Download latest version: https://firebot.app/
197-
6: Run the installer
198-
`),
199-
],
200-
},
201-
},
202-
{
203-
name: 'Bit Defender',
204-
message: {
205-
embeds: [
206-
getBaseEmbed().setTitle('Bit Defender').setDescription(`
207-
How to exclude applications in Bitdefender:
208-
- [bitdefender.com](https://www.bitdefender.com/business/support/en/77212-342964-general.html#UUID-7a762905-3544-7885-d4f5-7110909909d5_N1667164575537
209-
Here you can report false positives:
210-
- https://www.bitdefender.com/submit/
211-
`),
212-
],
213-
},
214-
},
215-
{
216-
name: 'But Another Bot Does It',
217-
message: {
218-
embeds: [
219-
getBaseEmbed().setTitle('But Another Bot Does It?').setDescription(`
220-
Just a friendly reminder, just because Software A supports something, that doesn't mean that Software B is required to support it.
221-
Things you want won't always appear in the software you use.
222-
This is true in all walks of computer life and why there are so many tools that do the same thing.
223-
`),
224-
],
225-
},
226-
},
227-
{
228-
name: 'Discord Mentions',
229-
message: {
230-
embeds: [
231-
getBaseEmbed().setTitle('Discord Mentions').setDescription(`
232-
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.
233-
Then use \`<@&roleid>\` in the message (e.g. \`<@&9471923849123483>\`).
234-
`),
235-
],
236-
},
237-
},
238-
{
239-
name: 'Firebot Expert',
240-
message: {
241-
embeds: [
242-
getBaseEmbed().setTitle('Firebot Expert Role').setDescription(`
243-
**What is It**
244-
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.
245-
246-
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.
247-
248-
249-
**How To Get It**
250-
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.
251-
252-
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.
253-
`),
254-
],
255-
},
256-
},
257-
{
258-
name: 'Data Folder',
259-
message: {
260-
embeds: [
261-
getBaseEmbed().setTitle('Data Folder').setDescription(`
262-
You can get to Firebot's data folder via File > Open Data Folder or by pressing "Win + R" and pasting: \`%appdata%\\firebot\\v5\\\`
263-
`),
264-
],
265-
},
266-
},
22+
authIssues,
23+
bitDefender,
24+
butAnother,
25+
cloudBackups,
26+
dataFolder,
27+
discordMentions,
28+
expert,
29+
firebotLogs,
30+
instalLog,
31+
manualRestore,
32+
nightly,
33+
obsTroubleShooting,
34+
offScreen,
35+
tuts,
26736
];
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { getBaseEmbed } from "../info-slash";
2+
3+
export const authIssues =
4+
{
5+
name: 'Auth Issues',
6+
message: {
7+
embeds: [
8+
getBaseEmbed().setTitle('Auth Issues').setDescription(`
9+
If you're experiencing issues with Firebot hanging on start up or failing to connect to Twitch, follow these steps to troubleshoot:
10+
11+
1. **Check Your Antivirus Software**
12+
- Verify that your antivirus software hasn't quarantined Firebot.
13+
14+
2. **Delete Saved Login File**
15+
If the issue persists, try deleting the file where Firebot saves login credentials:
16+
- Open your Firebot data folder via either of the following methods:
17+
- **A**:
18+
- In Firebot, go to **File** > **Open Data Folder**, then exit Firebot.
19+
- or **B**:
20+
- Press **Win + R** to open the Run dialog.
21+
- Paste \`%appdata%\\Firebot\\v5\\profiles\\\` into the field and press **Enter**.
22+
- Open your profile folder.
23+
- Delete the file named \`auth-twitch.json\`.
24+
- Restart Firebot and log in again.
25+
`),
26+
],
27+
},
28+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { getBaseEmbed } from "../info-slash";
2+
3+
export const bitDefender = {
4+
name: 'Bit Defender',
5+
message: {
6+
embeds: [
7+
getBaseEmbed().setTitle('Bit Defender').setDescription(`
8+
How to exclude applications in Bitdefender:
9+
- [bitdefender.com](https://www.bitdefender.com/business/support/en/77212-342964-general.html#UUID-7a762905-3544-7885-d4f5-7110909909d5_N1667164575537
10+
Here you can report false positives:
11+
- https://www.bitdefender.com/submit/
12+
`),
13+
],
14+
},
15+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { getBaseEmbed } from "../info-slash";
2+
3+
export const butAnother = {
4+
name: 'But Another Bot Does It',
5+
message: {
6+
embeds: [
7+
getBaseEmbed().setTitle('But Another Bot Does It?').setDescription(`
8+
Just a friendly reminder, just because Software A supports something, that doesn't mean that Software B is required to support it.
9+
Things you want won't always appear in the software you use.
10+
This is true in all walks of computer life and why there are so many tools that do the same thing.
11+
`),
12+
],
13+
},
14+
};

0 commit comments

Comments
 (0)