Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions grunt/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module.exports = function (grunt) {
x: 320, y: 240,
type: 'file',
path: config.installInstructionsPath,
name: 'Install Instructions'
name: 'Install Instructions.txt'
}]
: [])
];
Expand Down Expand Up @@ -144,7 +144,8 @@ module.exports = function (grunt) {
name: `firebot-v${version}-macos-x64`,
title: "Firebot Installer",
icon: macDmgIcon,
background: macDmgBg
background: macDmgBg,
installInstructionsPath: path.resolve(__dirname, '../macos-x64-install-instructions.txt')
},
arm64: {
appPath: macArmPathIn,
Expand Down
2 changes: 2 additions & 0 deletions macos-arm64-install-instructions.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Since Firebot is not notarized by Apple, macOS Gatekeeper will block it on first launch. Follow these steps to allow it to run:

1. Drag Firebot into the Applications folder
2. Open the Terminal app and run the following command (copy/paste and hit enter):
xattr -c /Applications/Firebot.app
9 changes: 9 additions & 0 deletions macos-x64-install-instructions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Since Firebot is not notarized by Apple, macOS Gatekeeper will block it on first launch. Follow these steps to allow it to run:

1. Drag Firebot into the Applications folder
2. Run Firebot
3. When the "Firebot Not Opened" alert appears, click "Done" (do NOT click "Move to Trash")
4. Open System Settings
5. Navigate to Privacy & Security
6. Scroll down and click "Open Anyway" next to "Firebot was blocked"
7. Click "Open Anyway"" in the confirmation dialog that appears
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "firebotv5",
"version": "5.65.2",
"version": "5.65.3",
"description": "Powerful all-in-one bot for Twitch streamers.",
"main": "build/main.js",
"scripts": {
Expand Down
38 changes: 33 additions & 5 deletions src/backend/app-management/electron/events/will-quit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,47 @@ async function cleanup() {
const { handleProfileDeletion, handleProfileRename } = await import("../../../app-management/profile-tasks");
handleProfileRename();
handleProfileDeletion();
}

export async function willQuit(event: Event) {
logger.debug("Will quit event triggered");

event.preventDefault();

const { EventManager } = await import("../../../events/event-manager");
await EventManager.triggerEvent("firebot", "before-firebot-closed", {
username: "Firebot"
});
}

export async function willQuit(event: Event) {
const { AppCloseListenerManager } = await import("../../app-close-listener-manager");
const { BackupManager } = await import("../../../backup-manager");
const { CustomVariableManager } = await import("../../../common/custom-variable-manager");
const { HotkeyManager } = await import("../../../hotkeys/hotkey-manager");
const { ScheduledTaskManager } = await import("../../../timers/scheduled-task-manager");
const { SettingsManager } = await import("../../../common/settings-manager");
const customScriptRunner = await import("../../../common/handlers/custom-scripts/custom-script-runner");
const viewerOnlineStatusManager = (await import("../../../viewers/viewer-online-status-manager")).default;

logger.debug("Will quit event triggered");
// Stop all scheduled tasks
ScheduledTaskManager.stop();

event.preventDefault();
// Stop all custom scripts so they can clean up
await customScriptRunner.stopAllScripts();

// Unregister all shortcuts.
HotkeyManager.unregisterAllHotkeys();

// Persist custom variables
CustomVariableManager.persistVariablesToFile();

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

if (SettingsManager.getSetting("BackupOnExit")) {
// Make a backup
await BackupManager.startBackup(false);
}

const { AppCloseListenerManager } = await import("../../app-close-listener-manager");

logger.debug("Running app close listeners...");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,36 +1,8 @@
import { app } from "electron";
import logger from "../../../logwrapper";

export async function windowsAllClosed() {
const { app } = await import("electron");
const { BackupManager } = await import("../../../backup-manager");
const { CustomVariableManager } = await import("../../../common/custom-variable-manager");
const { HotkeyManager } = await import("../../../hotkeys/hotkey-manager");
const { ScheduledTaskManager } = await import("../../../timers/scheduled-task-manager");
const { SettingsManager } = await import("../../../common/settings-manager");
const customScriptRunner = await import("../../../common/handlers/custom-scripts/custom-script-runner");
const viewerOnlineStatusManager = (await import("../../../viewers/viewer-online-status-manager")).default;

export function windowsAllClosed() {
logger.debug("All windows closed triggered");

// Stop all scheduled tasks
ScheduledTaskManager.stop();

// Stop all custom scripts so they can clean up
await customScriptRunner.stopAllScripts();

// Unregister all shortcuts.
HotkeyManager.unregisterAllHotkeys();

// Persist custom variables
CustomVariableManager.persistVariablesToFile();

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

if (SettingsManager.getSetting("BackupOnExit")) {
// Make a backup
await BackupManager.startBackup(false);
}

app.quit();
};
7 changes: 7 additions & 0 deletions src/backend/backup-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ class BackupManager {
manualActivation ? "_manual" : ""
}.${fileExtension}`;

if (!fs.existsSync(this._backupFolderPath)) {
logger.warn(`Backup path ${this._backupFolderPath} does not exist. Resetting to default.`);
SettingsManager.deleteSetting("BackupLocation");
this.updateBackupFolderPath();
SettingsManager.saveSetting("BackupLocationReset", true);
}

const output = fs.createWriteStream(path.join(this._backupFolderPath, filename));
const archive = archiver(fileExtension, {
zlib: { level: 9 }
Expand Down
3 changes: 2 additions & 1 deletion src/backend/chat/active-user-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type ChatUser = {
isMod?: boolean;
isVip?: boolean;
online?: boolean;
badges?: Map<string, string>;
};

type Events = {
Expand Down Expand Up @@ -238,7 +239,7 @@ class ActiveUserHandler extends TypedEmitter<Events> {
twitchRoles: [
...(chatUser.isBroadcaster ? ['broadcaster'] : []),
...(chatUser.isFounder || chatUser.isSubscriber ? ['sub'] : []),
...(chatUser.isMod ? ['mod'] : []),
...(chatUser.isMod || chatUser.badges?.has("lead_moderator") ? ['mod'] : []),
...(chatUser.isVip ? ['vip'] : [])
],
profilePicUrl: (await chatHelpers.getUserProfilePicUrl(chatUser.userId)),
Expand Down
2 changes: 1 addition & 1 deletion src/backend/chat/chat-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ class FirebotChatHelpers {
}

firebotChatMessage.isFounder = msg.userInfo.isFounder;
firebotChatMessage.isMod = msg.userInfo.isMod;
firebotChatMessage.isMod = msg.userInfo.isMod || msg.userInfo.badges.has("lead_moderator");
firebotChatMessage.isSubscriber = msg.userInfo.isSubscriber;
firebotChatMessage.isVip = msg.userInfo.isVip;

Expand Down
8 changes: 8 additions & 0 deletions src/backend/common/custom-variable-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class CustomVariableManager extends TypedEmitter<{
value,
ttl: this._cache.getTtl(key)
});

this.persistVariablesToFile();
}

private onCustomVariableExpire(key: string, value: unknown): void {
Expand All @@ -80,6 +82,8 @@ class CustomVariableManager extends TypedEmitter<{
key,
value
});

this.persistVariablesToFile();
}

private onCustomVariableDelete(key: string, value: unknown): void {
Expand All @@ -89,6 +93,8 @@ class CustomVariableManager extends TypedEmitter<{
});

frontendCommunicator.sendToVariableInspector("custom-variables:deleted", key);

this.persistVariablesToFile();
};

private getVariableCacheDb(): JsonDB {
Expand All @@ -112,6 +118,7 @@ class CustomVariableManager extends TypedEmitter<{
const db = this.getVariableCacheDb();
const persistAllVars = SettingsManager.getSetting("PersistCustomVariables");
if (persistAllVars) {
logger.debug("Persisting all custom variables to file");
db.push("/", this._cache.data);
} else {
const dataToPersist = Object.entries(this._cache.data as FirebotCacheData).reduce((acc, [key, { t, v, meta }]) => {
Expand All @@ -120,6 +127,7 @@ class CustomVariableManager extends TypedEmitter<{
}
return acc;
}, {} as FirebotCacheData);
logger.debug("Persisting specified custom variables to file");
db.push("/", dataToPersist);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ const model: EffectType<{
$scope.typeHasSettings = false;

function loadSelectedConfig(id: string) {
$scope.selectedConfig = overlayWidgetsService.getOverlayWidgetConfig(id);
const foundConfig = overlayWidgetsService.getOverlayWidgetConfig(id);
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
$scope.selectedConfig = foundConfig ? angular.copy(foundConfig) : null;
if ($scope.selectedConfig == null) {
$scope.selectedType = null;
$scope.settingsSchema = [];
Expand Down
7 changes: 7 additions & 0 deletions src/backend/effects/builtin/text-to-speech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ const effect: EffectType<{
style="margin: 0px 15px 0px 0px"
/>
</eos-container>

<eos-container header="Volume" pad-top="true">
<div class="muted">
<p style="margin-bottom: 5px;">Text-To-Speech volume can only be adjusted globally.</p>
<p>Go to <span class="font-bold">Settings -> TTS</span> to change the volume.</p>
</div>
</eos-container>
`,
optionsController: ($scope, ttsService) => {
if ($scope.effect.voiceId == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ class TwitchEventSubChatHelpers {
chatMessage.parts = messageParts;

chatMessage.isFounder = chatMessage.badges.some(b => b.title === "founder");
chatMessage.isMod = chatMessage.badges.some(b => b.title === "moderator");
chatMessage.isMod = chatMessage.badges.some(b => b.title === "moderator" || b.title === "lead_moderator");
chatMessage.isVip = chatMessage.badges.some(b => b.title === "vip");
chatMessage.isSubscriber = chatMessage.isFounder ||
chatMessage.badges.some(b => b.title === "subscriber");
Expand Down
7 changes: 6 additions & 1 deletion src/gui/app/app-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
});

app.controller("MainController", function($scope, $rootScope, $timeout, connectionService, utilityService,
settingsService, backupService, sidebarManager, logger, backendCommunicator, fontManager, ngToast, watcherCountService) {
settingsService, backupService, sidebarManager, logger, backendCommunicator, fontManager, ngToast, modalFactory) {
$rootScope.showSpinner = true;

$scope.fontAwesome5KitUrl = `https://kit.fontawesome.com/${secrets.fontAwesome5KitId}.js`;
Expand Down Expand Up @@ -516,6 +516,11 @@
keyboard: false,
backdrop: "static"
});*/

if (settingsService.getSetting("BackupLocationReset") === true) {
modalFactory.showInfoModal("Your previous backup location could not be found. Backup location has been reset to default. You can change it in Settings > Backups.");
settingsService.deleteSetting("BackupLocationReset");
}
});

// This adds a filter that we can use for ng-repeat, useful when we want to paginate something
Expand Down
26 changes: 18 additions & 8 deletions src/gui/app/directives/modals/roles/addOrEditCustomRoleModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</div>
</div>
<div class="modal-footer">
<button ng-if="!$ctrl.isNewRole" type="button" class="btn btn-danger pull-left" ng-click="$ctrl.delete()" uib-tooltip="Delete Role"><i class="fal fa-trash-alt"></i></button>
<button ng-if="!$ctrl.isNewRole" type="button" class="btn btn-danger pull-left" ng-click="$ctrl.showRoleDeleteModal()" uib-tooltip="Delete Role"><i class="fal fa-trash-alt"></i></button>
<button type="button" class="btn btn-link" ng-click="$ctrl.dismiss()">Cancel</button>
<button type="button" class="btn btn-primary" ng-click="$ctrl.save()">Save</button>
</div>
Expand Down Expand Up @@ -138,17 +138,27 @@
}
};

$ctrl.delete = function() {
$ctrl.showRoleDeleteModal = function(role) {
if ($ctrl.isNewRole) {
return;
}

$ctrl.close({
$value: {
role: $ctrl.role,
action: "delete"
}
});
utilityService
.showConfirmationModal({
title: "Delete Role",
question: "Are you sure you want to delete this role?",
confirmLabel: "Delete"
})
.then((confirmed) => {
if (confirmed) {
$ctrl.close({
$value: {
role: $ctrl.role,
action: "delete"
}
});
}
});
};

$ctrl.save = function() {
Expand Down
3 changes: 3 additions & 0 deletions src/types/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export type FirebotSettingsTypes = {
BackupIgnoreResources: boolean;
BackupKeepAll: boolean;
BackupLocation: string;
BackupLocationReset: boolean;
BackupOnceADay: boolean;
BackupOnExit: boolean;
ChatAlternateBackgrounds: boolean;
Expand Down Expand Up @@ -129,6 +130,7 @@ export const FirebotGlobalSettings: Partial<Record<keyof FirebotSettingsTypes, b
BackupIgnoreResources: true,
BackupKeepAll: true,
BackupLocation: true,
BackupLocationReset: true,
BackupOnceADay: true,
BackupOnExit: true,
DebugMode: true,
Expand Down Expand Up @@ -166,6 +168,7 @@ export const FirebotSettingsDefaults: FirebotSettingsTypes = {
BackupIgnoreResources: true,
BackupKeepAll: false,
BackupLocation: undefined,
BackupLocationReset: false,
BackupOnceADay: true,
BackupOnExit: true,
ChatAlternateBackgrounds: true,
Expand Down