added: Vote-to-skip

This commit is contained in:
NoLogicAlan committed 2026-09-13 01:21:36 +03:00
1 parent e315cfbc1d
commit cc0b438ef6
13 files changed
+206 -40

No files matched your search

+13
View File
@@ -11,6 +11,7 @@ import runnables from "../../settings/runnables.mjs";
import {
parseBool, displayValue, getGuildName, embed, tWrap, prettifySettingLabel,
BOOL_SETTINGS, VALID_LOCALES, VOLUME_MIN, VOLUME_MAX, PREFIX_MAX, SHORTCUTS,
VOTE_SKIP_THRESHOLD_MIN, VOTE_SKIP_THRESHOLD_MAX,
} from "./utils.mjs";
import {
get247Channels, save247Channels, build247Panel, disable247, handle247Toggle,
@@ -44,6 +45,18 @@ export async function applySet(ctx, message, set, key, rawValue) {
return null;
}
if (key === "voteSkipThreshold") {
const num = parseInt(rawValue, 10);
if (isNaN(num) || num < VOTE_SKIP_THRESHOLD_MIN || num > VOTE_SKIP_THRESHOLD_MAX) {
return ctx.t(message, "responses.settings.voteSkipThresholdRange", {
min: VOTE_SKIP_THRESHOLD_MIN,
max: VOTE_SKIP_THRESHOLD_MAX,
});
}
set.set(key, num);
return null;
}
if (key === "locale") {
if (!VALID_LOCALES.has(rawValue)) {
return ctx.t(message, "responses.settings.invalidLocale", {