mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-22 21:33:17 +00:00
Rename devId to devIds in config
This commit is contained in:
parent
97881f7331
commit
bc238d919d
@ -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({
|
||||
|
@ -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
|
||||
});
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ export default {
|
||||
|
||||
//support
|
||||
supportGuild: "https://discord.gg/rRA65Mn",
|
||||
devId: [
|
||||
devIDs: [
|
||||
"493174343484833802",
|
||||
"360363051792203779"
|
||||
],
|
||||
|
Loading…
Reference in New Issue
Block a user