mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
ahm
This commit is contained in:
1 parent
ba479e4c04
commit
441eb4406e
7 files changed
+29
-24
No files matched your search
+13
-9
@@ -59,19 +59,23 @@ export async function joinChannel(message, cid, cb = () => {}, ecb = () => {}) {
|
||||
const guildId = getGuildId(message);
|
||||
|
||||
const is247 = (() => {
|
||||
const raw = this.settingsMgr?.getServer?.(guildId)?.get?.("stay_247");
|
||||
return raw && raw !== "none";
|
||||
try {
|
||||
const raw = this.settingsMgr?.getServer?.(guildId)?.get?.("stay_247");
|
||||
return raw && raw !== "none";
|
||||
} catch (_) { return false; }
|
||||
})();
|
||||
|
||||
const mode247 = (() => {
|
||||
if (!is247) return "off";
|
||||
const set = this.settingsMgr?.getServer?.(guildId);
|
||||
const modes = set?.get?.("stay_247_modes");
|
||||
const matchCh = homeChannelId || activeChannelId;
|
||||
if (modes && typeof modes === "object" && !Array.isArray(modes) && modes[matchCh]) {
|
||||
return modes[matchCh];
|
||||
}
|
||||
return set?.get?.("stay_247_mode") ?? "off";
|
||||
try {
|
||||
const set = this.settingsMgr?.getServer?.(guildId);
|
||||
const modes = set?.get?.("stay_247_modes");
|
||||
const matchCh = homeChannelId || activeChannelId;
|
||||
if (modes && typeof modes === "object" && !Array.isArray(modes) && modes[matchCh]) {
|
||||
return modes[matchCh];
|
||||
}
|
||||
return set?.get?.("stay_247_mode") ?? "off";
|
||||
} catch (_) { return "off"; }
|
||||
})();
|
||||
|
||||
this.players.playerMap.delete(activeChannelId);
|
||||
|
||||
+1
-1
@@ -139,7 +139,7 @@ function extractPeriod(data, msg) {
|
||||
|
||||
/**
|
||||
* Resolve a Last.fm category (loved/top/recent/playlist) into playable tracks.
|
||||
* Shared between `$prefixlastfm play <cat>` and `$prefixplay lastfm:<cat>`.
|
||||
* Shared between `%lastfm play <cat>` and `%play lastfm:<cat>`.
|
||||
*
|
||||
* @param {object} ctx - The command `this` context (has .lastfm, .getPlayer, .handler, .t)
|
||||
* @param {object} msg - The message object
|
||||
|
||||
@@ -253,7 +253,7 @@ function build247StatusPanel(set, ctx, message, t, guildId) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a simple embed for the $prefix247 on/auto confirmation.
|
||||
* Build a simple embed for the %247 on/auto confirmation.
|
||||
* @param {object} set - ServerSettings
|
||||
* @param {string} channelId - Clean channel ID
|
||||
* @param {string} mode - "on" | "auto"
|
||||
@@ -298,7 +298,7 @@ function build247EnabledPanel(set, channelId, mode, joined, ctx, guildId, t) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a simple embed for the $prefix247 off confirmation.
|
||||
* Build a simple embed for the %247 off confirmation.
|
||||
* @param {object} set - ServerSettings
|
||||
* @param {string} channelId - Clean channel ID
|
||||
* @param {string} guildId - Guild ID
|
||||
@@ -630,7 +630,7 @@ export const command = function() {
|
||||
.addExamples(
|
||||
"$prefixsettings get",
|
||||
"$prefixsettings get prefix",
|
||||
"$prefixsettings set prefix !",
|
||||
"$prefixsettings set prefix %",
|
||||
"$prefixsettings set locale de-DE",
|
||||
"$prefixsettings set songAnnouncements off",
|
||||
"$prefixsettings set stay_247 auto",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { CommandBuilder } from "../src/CommandHandler.mjs";
|
||||
import { EmbedBuilder } from "@fluxerjs/core";
|
||||
import { getGlobalColor } from "../src/MessageHandler.mjs";
|
||||
import { logger } from "../src/constants/Logger.mjs";
|
||||
|
||||
const DEFAULT_ALIAS = "default";
|
||||
|
||||
|
||||
Reference in new issue
Block a user