Skip to content

Commit 19a336e

Browse files
authored
Merge pull request #3342 from crowbartools/v5
5.65.0-beta2 Release
2 parents d5b07e0 + e5389a8 commit 19a336e

118 files changed

Lines changed: 2999 additions & 1564 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

grunt/pack.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ module.exports = function (grunt) {
5555
'--out="./dist/pack"',
5656
'--arch=x64',
5757
`--electronVersion=${version}`,
58+
'--asar',
5859
'--prune',
5960
'--overwrite',
6061
'--version-string.ProductName="Firebot v5"',

package-lock.json

Lines changed: 333 additions & 699 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "firebotv5",
3-
"version": "5.65.0-beta1",
3+
"version": "5.65.0-beta2",
44
"description": "Powerful all-in-one bot for Twitch streamers.",
55
"main": "build/main.js",
66
"scripts": {
@@ -27,15 +27,15 @@
2727
"@types/angular": "^1.8.4",
2828
"@types/archiver": "^6.0.3",
2929
"@types/escape-html": "^1.0.4",
30-
"@types/express": "^5.0.3",
30+
"@types/express": "^5.0.5",
3131
"@types/luxon": "^3.7.1",
3232
"@types/node": "^22.18.0",
3333
"@types/roll": "^1.2.3",
3434
"@types/sprintf-js": "^1.1.4",
3535
"@types/unzipper": "^0.10.11",
3636
"@types/yargs-parser": "^21.0.3",
3737
"@typescript-eslint/parser": "^8.46.0",
38-
"electron": "^39.1.0",
38+
"electron": "^39.2.4",
3939
"electron-installer-dmg": "^5.0.1",
4040
"electron-winstaller": "^5.4.0",
4141
"eslint": "^9.37.0",
@@ -54,10 +54,10 @@
5454
"dependencies": {
5555
"@aws-sdk/client-polly": "^3.26.0",
5656
"@seald-io/nedb": "^4.0.4",
57-
"@twurple/api": "^7.4.0",
58-
"@twurple/auth": "^7.4.0",
59-
"@twurple/chat": "^7.4.0",
60-
"@twurple/eventsub-ws": "^7.4.0",
57+
"@twurple/api": "^8.0.2",
58+
"@twurple/auth": "^8.0.2",
59+
"@twurple/chat": "^8.0.2",
60+
"@twurple/eventsub-ws": "^8.0.2",
6161
"@types/tinycolor2": "^1.4.6",
6262
"@zunderscore/elgato-light-control": "^1.2.0",
6363
"angular": "^1.8.0",
@@ -75,10 +75,8 @@
7575
"angular-ui-sortable": "^0.18.0",
7676
"angular-ui-validate": "^1.2.3",
7777
"angularjs-color-picker": "^3.4.8",
78-
"angularjs-scroll-glue": "^2.2.0",
7978
"angularjs-slider": "^6.7.0",
8079
"archiver": "^7.0.1",
81-
"body-parser": "^1.19.0",
8280
"client-oauth2": "^4.3.3",
8381
"cm-resize": "^1.0.1",
8482
"codemirror": "^5.59.1",
@@ -90,7 +88,6 @@
9088
"deepmerge": "^4.2.2",
9189
"dompurify": "^3.3.0",
9290
"ejs": "^3.1.10",
93-
"electron-oauth2": "^3.0.0",
9491
"electron-regedit": "^2.0.0",
9592
"electron-window-state": "^5.0.3",
9693
"escape-html": "^1.0.3",
@@ -99,7 +96,7 @@
9996
"expressionish": "github:SReject/expressionish#d277e5d959e5b0cdf50a38a182016752a0de9dd6",
10097
"extra-life-ts": "^0.4.0",
10198
"firebot-nutjs": "github:crowbartools/firebot-nutjs#f52581d4c4426cf7f4dcc2b0d26cf56777e115f8",
102-
"form-data": "^4.0.0",
99+
"form-data": "^4.0.5",
103100
"fs-extra": "^11.2.0",
104101
"fuse.js": "^7.1.0",
105102
"glob": "^10.3.10",
@@ -115,7 +112,6 @@
115112
"node-json-db": "^1.4.1",
116113
"node-xlsx": "^0.24.0",
117114
"obs-websocket-js": "^5.0.6",
118-
"request": "^2.85.0",
119115
"roll": "^1.2.0",
120116
"sanitize-filename": "^1.6.3",
121117
"socket.io-client": "^2.3.0",

src/backend/app-management/electron/events/second-instance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Event } from "electron";
1+
import type { BrowserWindow, Event } from "electron";
22
import logger from "../../../logwrapper";
33

44
export async function secondInstance(event: Event, argv: string[]) {
@@ -10,7 +10,7 @@ export async function secondInstance(event: Event, argv: string[]) {
1010
try {
1111
logger.debug("Second instance detected, focusing main window.");
1212

13-
const { mainWindow } = await import("../window-management");
13+
const mainWindow = globalThis.mainWindow as BrowserWindow;
1414
if (mainWindow) {
1515
if (!mainWindow.isVisible()) {
1616
mainWindow.show();

src/backend/app-management/electron/events/when-ready.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,8 @@ export async function whenReady() {
193193
builtinGameLoader.loadGames();
194194

195195
windowManagement.updateSplashScreenStatus("Loading custom variables...");
196-
const { SettingsManager } = await import("../../../common/settings-manager");
197-
if (SettingsManager.getSetting("PersistCustomVariables")) {
198-
const { CustomVariableManager } = await import("../../../common/custom-variable-manager");
199-
CustomVariableManager.loadVariablesFromFile();
200-
}
196+
const { CustomVariableManager } = await import("../../../common/custom-variable-manager");
197+
CustomVariableManager.loadVariablesFromFile();
201198

202199
windowManagement.updateSplashScreenStatus("Loading sort tags...");
203200
const { SortTagManager } = await import("../../../sort-tags/sort-tag-manager");

src/backend/app-management/electron/events/windows-all-closed.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ export async function windowsAllClosed() {
2222
HotkeyManager.unregisterAllHotkeys();
2323

2424
// Persist custom variables
25-
if (SettingsManager.getSetting("PersistCustomVariables")) {
26-
CustomVariableManager.persistVariablesToFile();
27-
}
25+
CustomVariableManager.persistVariablesToFile();
2826

2927
// Set all users to offline
3028
await viewerOnlineStatusManager.setAllViewersOffline();

src/backend/chat/chat-listeners/twitch-chat-listeners.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ exports.setupChatListeners = (streamerChatClient, botChatClient) => {
7070
firebotChatMessage.customRewardId = HIGHLIGHT_MESSAGE_REWARD_ID;
7171
firebotChatMessage.reward = {
7272
id: HIGHLIGHT_MESSAGE_REWARD_ID,
73-
name: "Highlight Message",
73+
name: "Highlight My Message",
7474
cost: 0,
7575
imageUrl: "https://static-cdn.jtvnw.net/automatic-reward-images/highlight-4.png"
7676
};

src/backend/chat/commands/builtin/steam/steam-access.ts

Lines changed: 24 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1-
import Fuse from "fuse.js";
2-
1+
import { AccountAccess } from "../../../../common/account-access";
32
import logger from "../../../../logwrapper";
43

5-
interface SteamCacheItem {
6-
appid: number;
7-
name: string;
8-
}
9-
10-
interface SteamAppList {
11-
applist: {
12-
apps: SteamCacheItem[]
13-
}
14-
}
15-
164
interface SteamAppDetails {
175
name: string;
186
short_description: string;
@@ -50,34 +38,9 @@ interface FirebotSteamGameDetails {
5038
url: string;
5139
}
5240

53-
class SteamCacheManager {
54-
private _steamCache: SteamCacheItem[] = [];
55-
56-
async cacheSteamLibrary(): Promise<boolean> {
57-
if (this._steamCache.length > 0) {
58-
logger.debug('Steam library is still cached. No need to pull again.');
59-
return false;
60-
}
61-
62-
logger.debug('Refreshing Steam library cache');
63-
const url = "https://api.steampowered.com/ISteamApps/GetAppList/v2/";
64-
try {
65-
const response = await (await fetch(url)).json() as SteamAppList;
66-
67-
if (response?.applist?.apps != null) {
68-
this._steamCache = response.applist.apps;
69-
return true;
70-
}
71-
72-
return false;
73-
} catch (error) {
74-
logger.error("Unable to get Steam library from Steam API.", error.message);
75-
return false;
76-
}
77-
}
78-
41+
class SteamManager {
7942
async getSteamGameDetails(requestedGame: string, countryCode?: string) {
80-
const appId = await this.getAppIdFromSteamCache(requestedGame);
43+
const appId = await this.getAppIdFromGameName(requestedGame);
8144
if (appId == null) {
8245
logger.debug('Could not retrieve app id for Steam search.');
8346
return null;
@@ -116,25 +79,30 @@ class SteamCacheManager {
11679
return gameDetails;
11780
}
11881

119-
private async getAppIdFromSteamCache(requestedGame: string): Promise<number> {
120-
// Try to cache library if we don't have one yet.
121-
if (this._steamCache.length === 0) {
122-
const cacheSuccess = await this.cacheSteamLibrary();
82+
private async getAppIdFromGameName(gameName: string): Promise<number> {
83+
const streamer = AccountAccess.getAccounts().streamer;
12384

124-
if (!cacheSuccess) {
125-
return null;
126-
}
85+
if (!streamer?.loggedIn) {
86+
return null;
12787
}
88+
try {
89+
const response = await fetch(`https://api.crowbar.tools/v1/steam/find-app-id?search=${encodeURIComponent(gameName)}`, {
90+
method: "GET",
91+
headers: {
92+
'User-Agent': 'Firebot V5 - https://firebot.app',
93+
'Authorization': `Bearer ${streamer.auth.access_token}`
94+
}
95+
});
12896

129-
// Now, let's search the app list and get the closest result.
130-
const searchOptions = {
131-
keys: ['name'],
132-
id: 'appid'
133-
};
134-
const fuse = new Fuse(this._steamCache, searchOptions);
97+
if (response?.ok) {
98+
const data = await response.json() as { appId: number | null };
99+
return data.appId;
100+
}
101+
} catch (error) {
102+
logger.error('Steam app ID fetch failed.', (error as Error).message);
103+
}
135104

136-
const search = fuse.search(requestedGame);
137-
return search[0]?.item?.appid;
105+
return null;
138106
}
139107

140108
private async getSteamAppDetails(appId: number, countryCode?: string): Promise<Partial<SteamAppDetails>> {
@@ -163,6 +131,6 @@ class SteamCacheManager {
163131
}
164132
}
165133

166-
const steamCacheManager = new SteamCacheManager();
134+
const steamCacheManager = new SteamManager();
167135

168136
export = steamCacheManager;

src/backend/chat/commands/builtin/steam/steam.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const SteamSystemCommand: SystemCommand<{
3333
countryCode: {
3434
type: "string",
3535
title: "Country Code (Optional)",
36-
tip: "A two-letter ISO-3166 country code. Examples: US, CA, SE, NO",
36+
tip: "A two-letter [ISO-3166](https://wikipedia.org/wiki/List_of_ISO_3166_country_codes) country code. Examples: US, CA, SE, NO",
3737
default: ""
3838
}
3939
}

src/backend/chat/commands/command-runner.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { AccountAccess } from "../../common/account-access";
66
import { CommandManager } from "./command-manager";
77
import effectRunner from "../../common/effect-runner";
88
import chatHelpers from "../chat-helpers";
9-
import twitchStreamInfoManager from "../../streaming-platforms/twitch/stream-info-manager";
109
import frontendCommunicator from "../../common/frontend-communicator";
1110
import logger from "../../logwrapper";
1211

@@ -99,10 +98,6 @@ class CommandRunner {
9998
}
10099

101100
private execute(command: CommandDefinition, userCommand: UserCommand, firebotChatMessage?: FirebotChatMessage, manual = false) {
102-
if (command.onlyTriggerWhenChannelIsLive && !twitchStreamInfoManager.streamInfo.isLive && !manual) {
103-
return;
104-
}
105-
106101
let effects = command.effects;
107102
if (command.subCommands && command.subCommands.length > 0 && userCommand.subcommandId != null) {
108103
if (userCommand.subcommandId === "fallback-subcommand" && command.fallbackSubcommand) {

0 commit comments

Comments
 (0)