Rename devId to devIds in config

This commit is contained in:
Christer Warén 2023-06-06 04:37:06 +03:00
parent 97881f7331
commit bc238d919d
5 changed files with 12 additions and 19 deletions

View File

@ -28,7 +28,6 @@ export default class RadioClient extends Client {
public streamer: Streamer | null;
public statistics: Statistics | null;
public radio: Radio | null;
public developers: string | undefined;
constructor() {
super({

View File

@ -13,7 +13,7 @@ export default {
async execute(interaction: ButtonInteraction | ChatInputCommandInteraction | StringSelectMenuInteraction, client: RadioClient) {
let message: any = {};
if(!client.funcs.isDev(client.config.devId, interaction.user.id)) return interaction.reply({
if(!client.funcs.isDev(client.config.devIDs, interaction.user.id)) return interaction.reply({
content: client.messages.emojis["error"] + client.messages.notAllowed,
ephemeral: true
});

View File

@ -20,17 +20,11 @@ export default async function ready(client: RadioClient) {
client.funcs.logger('Datastore', 'Ready');
/*DEVELOPERS*/
client.developers = "";
let user : any= "";
for (let i = 0; i < client.config.devId.length; i++) {
user = await client.users.fetch(client.config.devId[i]);
client.funcs.logger('Developers', user.tag);
if (i == client.config.devId.length - 1) {
client.developers += user.tag;
} else {
client.developers += user.tag + " & ";
}
let developers : string[] = [];
for(let devID of client.config.devIDs){
developers.push((await client.users.fetch(devID)).tag);
}
client.funcs.logger('Developers', developers.join(" & "));
/*STATIONS*/
client.stations = new Stations();

View File

@ -1,10 +1,10 @@
export default function isDev(devList : any, authorID : any){
import { Snowflake } from "discord.js";
export default function isDev(devIDs : any[], authorID : Snowflake){
let response = false;
Object.keys(devList).forEach(function(oneDev) {
let devID = devList[oneDev];
for (const devID of devIDs){
if(authorID == devID){
response = true;
return true;
}
}
});
return response;
}

View File

@ -8,7 +8,7 @@ export default {
//support
supportGuild: "https://discord.gg/rRA65Mn",
devId: [
devIDs: [
"493174343484833802",
"360363051792203779"
],