Added node version check, some cleanup
This commit is contained in:
parent
fb0c8ffae1
commit
fd77ace48e
7 changed files with 19 additions and 12 deletions
|
@ -44,8 +44,8 @@ export async function removeTag(name, guild) {
|
|||
|
||||
export async function disableCommand(guild, command) {
|
||||
const guildDB = await this.getGuild(guild);
|
||||
await connection.query("UPDATE guilds SET disabled_commands = $1 WHERE guild_id = $2", [(guildDB.disabled_commands ? [...guildDB.disabled_commands, command] : [command]).filter((v) => v !== undefined), guild]);
|
||||
disabledCmdCache.set(guild, guildDB.disabled_commands ? [...guildDB.disabled_commands, command] : [command].filter((v) => v !== undefined));
|
||||
await connection.query("UPDATE guilds SET disabled_commands = $1 WHERE guild_id = $2", [(guildDB.disabled_commands ? [...guildDB.disabled_commands, command] : [command]).filter((v) => !!v), guild]);
|
||||
disabledCmdCache.set(guild, guildDB.disabled_commands ? [...guildDB.disabled_commands, command] : [command].filter((v) => !!v));
|
||||
}
|
||||
|
||||
export async function enableCommand(guild, command) {
|
||||
|
@ -138,4 +138,4 @@ export async function setup() {
|
|||
|
||||
export async function stop() {
|
||||
await connection.end();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,8 +73,8 @@ export async function getCounts() {
|
|||
|
||||
export async function disableCommand(guild, command) {
|
||||
const guildDB = await this.getGuild(guild);
|
||||
connection.prepare("UPDATE guilds SET disabled_commands = ? WHERE guild_id = ?").run(JSON.stringify((guildDB.disabledCommands ? [...JSON.parse(guildDB.disabledCommands), command] : [command]).filter((v) => v !== undefined)), guild);
|
||||
collections.disabledCmdCache.set(guild, guildDB.disabled_commands ? [...JSON.parse(guildDB.disabledCommands), command] : [command].filter((v) => v !== undefined));
|
||||
connection.prepare("UPDATE guilds SET disabled_commands = ? WHERE guild_id = ?").run(JSON.stringify((guildDB.disabledCommands ? [...JSON.parse(guildDB.disabledCommands), command] : [command]).filter((v) => !!v)), guild);
|
||||
collections.disabledCmdCache.set(guild, guildDB.disabled_commands ? [...JSON.parse(guildDB.disabledCommands), command] : [command].filter((v) => !!v));
|
||||
}
|
||||
|
||||
export async function enableCommand(guild, command) {
|
||||
|
|
|
@ -7,7 +7,7 @@ class PrometheusWorker extends BaseServiceWorker {
|
|||
constructor(setup) {
|
||||
super(setup);
|
||||
|
||||
if (process.env.METRICS !== "" && process.env.METRICS !== undefined) {
|
||||
if (process.env.METRICS && process.env.METRICS !== "") {
|
||||
this.httpServer = createServer(async (req, res) => {
|
||||
if (req.method !== "GET") {
|
||||
res.statusCode = 405;
|
||||
|
|
|
@ -68,7 +68,7 @@ export async function play(client, sound, message, music = false) {
|
|||
if (!tracks || tracks.length === 0) return "I couldn't find that song!";
|
||||
if (music) {
|
||||
const sortedTracks = tracks.map((val) => { return val.track; });
|
||||
const playlistTracks = playlistInfo.selectedTrack !== undefined ? sortedTracks : [sortedTracks[0]];
|
||||
const playlistTracks = playlistInfo.selectedTrack ? sortedTracks : [sortedTracks[0]];
|
||||
queues.set(voiceChannel.guild.id, oldQueue ? [...oldQueue, ...playlistTracks] : playlistTracks);
|
||||
}
|
||||
const connection = await manager.join({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue