[deploy]
All checks were successful
Deploy Discord Bot / deploy (push) Successful in 37s

This commit is contained in:
Pascal Prießnitz
2025-12-04 16:43:38 +01:00
parent 311f5a87f1
commit 22caa79b54
60 changed files with 2652 additions and 2999 deletions

View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initConfig = initConfig;
exports.getConfig = getConfig;
exports.getState = getState;
exports.setState = setState;
exports.subscribe = subscribe;
let config = null;
let state = {};
const listeners = new Set();
function initConfig(next) {
config = next;
state = {
guildId: next.initialGuildId,
isAdmin: next.isAdmin,
userLabel: next.userLabel
};
}
function getConfig() {
return config;
}
function getState() {
return state;
}
function setState(partial) {
state = { ...state, ...partial };
listeners.forEach((l) => l(state));
}
function subscribe(listener) {
listeners.add(listener);
return () => listeners.delete(listener);
}