Convert spaces to tabs

This commit is contained in:
SileNce5k 2021-04-21 18:36:52 +02:00
parent 4576eec78a
commit db04c07c60
No known key found for this signature in database
GPG key ID: C507260E7F2583AD
17 changed files with 327 additions and 327 deletions

View file

@ -5,20 +5,20 @@ const creationJoinDates = require("../util/creationJoinDates")
module.exports = {
name: 'botinfo',
description: 'Shows information about the bot',
execute({message, client}) {
let createJoin = creationJoinDates(client.user)
const embed = new Discord.MessageEmbed()
.setColor(15780145)
.setTitle("Information about bot")
.setTimestamp()
.setAuthor(client.user.username, "https://cdn.discordapp.com/avatars/481128222147477506/1a30f57f8e403f54aaca502012aeff14.png?size=2048")
.addFields({
name: "General info", value: `Name: ${client.user.username}\nPrefix: ${prefix}\nTotal Servers: ${client.guilds.toString().length}\nCreation Date: ${createJoin.creation}\nSource: [Click Here](https://github.com/SileNce5k/discord_bot)`,
},)
name: 'botinfo',
description: 'Shows information about the bot',
execute({message, client}) {
let createJoin = creationJoinDates(client.user)
const embed = new Discord.MessageEmbed()
.setColor(15780145)
.setTitle("Information about bot")
.setTimestamp()
.setAuthor(client.user.username, "https://cdn.discordapp.com/avatars/481128222147477506/1a30f57f8e403f54aaca502012aeff14.png?size=2048")
.addFields({
name: "General info", value: `Name: ${client.user.username}\nPrefix: ${prefix}\nTotal Servers: ${client.guilds.toString().length}\nCreation Date: ${createJoin.creation}\nSource: [Click Here](https://github.com/SileNce5k/discord_bot)`,
},)
message.channel.send(embed)
message.channel.send(embed)
}
}
};

View file

@ -1,25 +1,25 @@
module.exports = {
name: 'e',
description: 'Returns emoji url',
execute({message, args}) {
name: 'e',
description: 'Returns emoji url',
execute({ message, args }) {
let emoji = args.join(` `);
if (!emoji) {
message.channel.send("no emoji");
return;
message.channel.send("no emoji");
return;
}
if (args[0].charAt(1) == "a") {
var extension = ".gif";
var extension = ".gif";
} else
var extension = ".png"
var num = emoji.split(":")[2];
try {
num = num.slice(0, -1);
num = num.slice(0, -1);
} catch (e) {
message.channel.send("There was an error.");
return;
message.channel.send("There was an error.");
return;
}
message.channel.send("https://cdn.discordapp.com/emojis/" + num + extension);
}
}
};

View file

@ -3,45 +3,45 @@ const Discord = require('discord.js');
module.exports = {
name: 'help',
description: 'List all available commands.',
execute({ message, args, prefix }) {
var commands = " "
let commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
let x = 0
if (args[0] == "netload") {
commandFiles = fs.readdirSync('./netload').filter(file => file.endsWith('.js'));
if (commandFiles.length == 0) {
message.channel.send("There are no netmodules currently loaded.")
x = 1;
}
}
if (x == 1) return;
name: 'help',
description: 'List all available commands.',
execute({ message, args, prefix }) {
var commands = " "
let commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
let x = 0
if (args[0] == "netload") {
commandFiles = fs.readdirSync('./netload').filter(file => file.endsWith('.js'));
if (commandFiles.length == 0) {
message.channel.send("There are no netmodules currently loaded.")
x = 1;
}
}
if (x == 1) return;
const embed = new Discord.MessageEmbed()
.setColor(15780145)
.setTitle("Commands")
.setTimestamp()
.setAuthor("soilens bot", "https://cdn.discordapp.com/avatars/481128222147477506/1a30f57f8e403f54aaca502012aeff14.png?size=2048")
const embed = new Discord.MessageEmbed()
.setColor(15780145)
.setTitle("Commands")
.setTimestamp()
.setAuthor("soilens bot", "https://cdn.discordapp.com/avatars/481128222147477506/1a30f57f8e403f54aaca502012aeff14.png?size=2048")
for (const file of commandFiles) {
const command = require(`./${file}`);
for (const file of commandFiles) {
const command = require(`./${file}`);
if (args[0] == "admin") {
if (command.admin && !command.disabled)
commands = commands + `${prefix}${command.name} | ${command.description}\n`
} else
if (!command.admin && !command.disabled)
commands = commands + `${prefix}${command.name} | ${command.description}\n`
}
embed.addFields(
{ name: "General", value: commands },
)
if (args[0] == "admin") {
if (command.admin && !command.disabled)
commands = commands + `${prefix}${command.name} | ${command.description}\n`
} else
if (!command.admin && !command.disabled)
commands = commands + `${prefix}${command.name} | ${command.description}\n`
}
embed.addFields(
{ name: "General", value: commands },
)
message.channel.send(embed);
},
message.channel.send(embed);
},
};

View file

@ -4,62 +4,62 @@ const netloadDir = "./netload"
const validUrl = require('valid-url');
module.exports = {
name: 'netload',
description: 'Load a module from the internet',
execute({ message, args, prefix, client, owners }) {
let json = fs.readFileSync('netmoduleWhitelist.json', 'utf8');
let whitelist = JSON.parse(json)
console.log(json.indexOf(message.author.id.toString()) == -1)
if (json.indexOf(message.author.id.toString()) == -1) {
message.channel.send("You do not have permissions to use this command.");
return;
}
if (args[0] == "whitelist" && owners.indexOf(message.author.id.toString()) >= 0) {
whitelist.push(args[1])
fs.writeFileSync("netmoduleWhitelist.json", JSON.stringify(whitelist))
return;
}
if (!args[0] && message.attachments.size == 0) {
message.channel.send(`You have to either specify a url or upload a file via the command.\nTo get an example file, execute \`${prefix}netload example\``)
return;
name: 'netload',
description: 'Load a module from the internet',
execute({ message, args, prefix, client, owners }) {
let json = fs.readFileSync('netmoduleWhitelist.json', 'utf8');
let whitelist = JSON.parse(json)
console.log(json.indexOf(message.author.id.toString()) == -1)
if (json.indexOf(message.author.id.toString()) == -1) {
message.channel.send("You do not have permissions to use this command.");
return;
}
if (args[0] == "whitelist" && owners.indexOf(message.author.id.toString()) >= 0) {
whitelist.push(args[1])
fs.writeFileSync("netmoduleWhitelist.json", JSON.stringify(whitelist))
return;
}
if (!args[0] && message.attachments.size == 0) {
message.channel.send(`You have to either specify a url or upload a file via the command.\nTo get an example file, execute \`${prefix}netload example\``)
return;
} if (args[0] == "example") {
message.channel.send({ files: [{ attachment: "./commands/.example" }] })
return;
}
} if (args[0] == "example") {
message.channel.send({ files: [{ attachment: "./commands/.example" }] })
return;
}
let url, fileName;
if (message.attachments.size > 0) {
url = message.attachments.first().url
fileName = message.attachments.first().name
} else {
url = args[0]
if (!validUrl.isUri(url)) {
message.channel.send("This does not look like a valid url")
return;
}
fileName = args[0].split("/")[args[0].split("/").length - 1]
}
if (fs.existsSync(`${netloadDir}/${fileName}`)) {
message.channel.send(`A module with this filename(${fileName}) already exists.`)
return;
}
https.get(url, (res) => {
res.on('data', (d) => {
fs.writeFileSync(`${netloadDir}/${fileName}`, d);
loadNetModules(client);
});
let url, fileName;
if (message.attachments.size > 0) {
url = message.attachments.first().url
fileName = message.attachments.first().name
} else {
url = args[0]
if (!validUrl.isUri(url)) {
message.channel.send("This does not look like a valid url")
return;
}
fileName = args[0].split("/")[args[0].split("/").length - 1]
}
if (fs.existsSync(`${netloadDir}/${fileName}`)) {
message.channel.send(`A module with this filename(${fileName}) already exists.`)
return;
}
https.get(url, (res) => {
res.on('data', (d) => {
fs.writeFileSync(`${netloadDir}/${fileName}`, d);
loadNetModules(client);
});
}).on('error', (e) => {
message.channel.send("Error download file.");
console.log(e)
});
}).on('error', (e) => {
message.channel.send("Error download file.");
console.log(e)
});
let loadNetModules = require('../util/loadNetModules');
loadNetModules(client)
let loadNetModules = require('../util/loadNetModules');
loadNetModules(client)
}
}
};

View file

@ -5,13 +5,13 @@ module.exports = {
description: 'Returns profile picture',
execute({message, args}) {
let info;
if (!args[0]) {
info = message.author.id;
} else {
info = parseMention(args[0], message.guild);
}
let user = message.guild.members.cache.get(info);
if (!args[0]) {
info = message.author.id;
} else {
info = parseMention(args[0], message.guild);
}
let user = message.guild.members.cache.get(info);
message.channel.send(user.user.avatarURL({ format: 'png', dynamic: true, size: 4096 }))
message.channel.send(user.user.avatarURL({ format: 'png', dynamic: true, size: 4096 }))
}
};

View file

@ -2,19 +2,19 @@ const parseMention = require("../util/parseMention");
const setServerPrefix = require("../util/setServerPrefix");
module.exports = {
name: 'prefix',
description: 'Change the prefix of the bot in this server.',
execute({ message, client, args, prefix }) {
if (!message.member.hasPermission('MANAGE_GUILD')) {
message.channel.send("You do not have sufficient permissions(MANAGE_GUILD) to change the prefix of this server.")
return;
}
if (!args[0]) {
message.channel.send(`To change the prefix, execute \`${prefix}prefix <newPrefix>\``);
return;
}else{
setServerPrefix(client, args[0], message.guild.id)
message.channel.send(`The prefix for this server is now set to ${args[0]}`)
}
}
name: 'prefix',
description: 'Change the prefix of the bot in this server.',
execute({ message, client, args, prefix }) {
if (!message.member.hasPermission('MANAGE_GUILD')) {
message.channel.send("You do not have sufficient permissions(MANAGE_GUILD) to change the prefix of this server.")
return;
}
if (!args[0]) {
message.channel.send(`To change the prefix, execute \`${prefix}prefix <newPrefix>\``);
return;
}else{
setServerPrefix(client, args[0], message.guild.id)
message.channel.send(`The prefix for this server is now set to ${args[0]}`)
}
}
};

View file

@ -1,16 +1,16 @@
const randomNumber = require('../util/randomNumber')
module.exports = {
name: 'random',
description: 'Returns a value between two numbers (default = 1-10)',
execute({ message, args }) {
let min = 1
let max = 10
if (args[0] && args[1]) {
min = parseInt(args[0])
max = parseInt(args[1])
}
let randNumber= randomNumber(min,max)
message.channel.send(randNumber)
}
name: 'random',
description: 'Returns a value between two numbers (default = 1-10)',
execute({ message, args }) {
let min = 1
let max = 10
if (args[0] && args[1]) {
min = parseInt(args[0])
max = parseInt(args[1])
}
let randNumber= randomNumber(min,max)
message.channel.send(randNumber)
}
};

View file

@ -4,20 +4,20 @@ module.exports = {
name: 'serverinfo',
description: 'Displays information about the server',
execute({message}) {
console.log(message.guild.emojis.cache)
const embed = new Discord.MessageEmbed()
.setThumbnail(message.guild.iconURL({ format: 'png', dynamic: true, size: 4096 }))
.setColor("#ee7939")
.setTimestamp()
.addField("Server Owner: ", `<@${message.guild.ownerID}>`)
.addField("Server Name: ", message.guild.name)
.addField("Created", message.guild.createdAt.toUTCString())
.addField("Members: ", message.guild.memberCount)
//.addField("Emojis: ", message.guild.emojis.cache.array().length)
console.log(message.guild.emojis.cache)
const embed = new Discord.MessageEmbed()
.setThumbnail(message.guild.iconURL({ format: 'png', dynamic: true, size: 4096 }))
.setColor("#ee7939")
.setTimestamp()
.addField("Server Owner: ", `<@${message.guild.ownerID}>`)
.addField("Server Name: ", message.guild.name)
.addField("Created", message.guild.createdAt.toUTCString())
.addField("Members: ", message.guild.memberCount)
//.addField("Emojis: ", message.guild.emojis.cache.array().length)
message.channel.send(embed);
}
message.channel.send(embed);
}
};

View file

@ -1,31 +1,31 @@
const parseMS = require('parse-ms')
module.exports = {
name: 'uptime',
description: 'Returns uptime',
execute({message, client}) {
name: 'uptime',
description: 'Returns uptime',
execute({message, client}) {
let days = "";
let hours = "";
let minutes = "";
let seconds = "";
let milliseconds = "";
let days = "";
let hours = "";
let minutes = "";
let seconds = "";
let milliseconds = "";
let uptime = parseMS(client.uptime)
if (uptime.days != 0)
days = `${uptime.days} days, `
if (uptime.hours != 0)
hours = `${uptime.hours} hours, `
if (uptime.minutes != 0)
minutes = `${uptime.minutes} minutes, `
if (uptime.seconds != 0)
seconds = `${uptime.seconds} seconds `
if (uptime.milliseconds != 0)
milliseconds = `and ${uptime.milliseconds} milliseconds`
let uptime = parseMS(client.uptime)
if (uptime.days != 0)
days = `${uptime.days} days, `
if (uptime.hours != 0)
hours = `${uptime.hours} hours, `
if (uptime.minutes != 0)
minutes = `${uptime.minutes} minutes, `
if (uptime.seconds != 0)
seconds = `${uptime.seconds} seconds `
if (uptime.milliseconds != 0)
milliseconds = `and ${uptime.milliseconds} milliseconds`
let fullUptime = `This bot has an uptime of ${days}${hours}${minutes}${seconds}${milliseconds}`
let fullUptime = `This bot has an uptime of ${days}${hours}${minutes}${seconds}${milliseconds}`
message.channel.send(fullUptime)
}
message.channel.send(fullUptime)
}
};

View file

@ -3,38 +3,38 @@ const parseMention = require("../util/parseMention.js")
const creationJoinDates = require("../util/creationJoinDates")
module.exports = {
name: 'userinfo',
description: 'Displays information about the user',
execute({message, args}) {
let info;
let nickname = "";
if (!args[0]) {
info = message.author.id;
} else {
info = parseMention(args[0], message.guild);
}
var user = message.guild.members.cache.get(info);
if (user.user.nickname) {
nickname = ` <:aka:572089580925485058> ${user.user.nickname} `;
}
name: 'userinfo',
description: 'Displays information about the user',
execute({message, args}) {
let info;
let nickname = "";
if (!args[0]) {
info = message.author.id;
} else {
info = parseMention(args[0], message.guild);
}
var user = message.guild.members.cache.get(info);
if (user.user.nickname) {
nickname = ` <:aka:572089580925485058> ${user.user.nickname} `;
}
var roleColor = 15788778;
if (user.roles.color) {
roleColor = user.roles.color.color;
}
var roleColor = 15788778;
if (user.roles.color) {
roleColor = user.roles.color.color;
}
var createJoin = creationJoinDates(user.user)
const embed = new Discord.MessageEmbed()
.setThumbnail(user.user.avatarURL({ format: 'png', dynamic: true, size: 2048 }))
.setColor(roleColor)
.setTimestamp()
.setAuthor(user.user.username, user.user.avatarURL({ format: 'png', dynamic: true, size: 2048 }))
.addField("Username", `**${user.user.username}#${user.user.discriminator}**${nickname}`)
.addField("Presence", user.user.presence.activities[0].name)
//.addField("Joined", createJoin.joindate, true)
.addField("Creation date", createJoin.creation, true)
.addField("Join date", user.joinDate, true)
var createJoin = creationJoinDates(user.user)
const embed = new Discord.MessageEmbed()
.setThumbnail(user.user.avatarURL({ format: 'png', dynamic: true, size: 2048 }))
.setColor(roleColor)
.setTimestamp()
.setAuthor(user.user.username, user.user.avatarURL({ format: 'png', dynamic: true, size: 2048 }))
.addField("Username", `**${user.user.username}#${user.user.discriminator}**${nickname}`)
.addField("Presence", user.user.presence.activities[0].name)
//.addField("Joined", createJoin.joindate, true)
.addField("Creation date", createJoin.creation, true)
.addField("Join date", user.joinDate, true)
message.channel.send(embed);
}
message.channel.send(embed);
}
};

View file

@ -1,34 +1,34 @@
module.exports = function (user) {
let creationMonth, creationDate, creationHours, creationMinutes, creationSeconds;
let creationMonth, creationDate, creationHours, creationMinutes, creationSeconds;
if (user.createdAt.getUTCMonth().toString().length === 1)
creationMonth = "0" + (1+user.createdAt.getUTCMonth())
else
creationMonth = (1+user.createdAt.getUTCMonth())
if (user.createdAt.getUTCMonth().toString().length === 1)
creationMonth = "0" + (1+user.createdAt.getUTCMonth())
else
creationMonth = (1+user.createdAt.getUTCMonth())
if (user.createdAt.getUTCDate().toString().length === 1)
creationDate = "0" + user.createdAt.getUTCDate()
else
creationDate = user.createdAt.getUTCDate()
if (user.createdAt.getUTCDate().toString().length === 1)
creationDate = "0" + user.createdAt.getUTCDate()
else
creationDate = user.createdAt.getUTCDate()
if (user.createdAt.getUTCHours().toString().length === 1)
creationHours = "0" + user.createdAt.getUTCHours()
else
creationHours = user.createdAt.getUTCHours()
if (user.createdAt.getUTCHours().toString().length === 1)
creationHours = "0" + user.createdAt.getUTCHours()
else
creationHours = user.createdAt.getUTCHours()
if (user.createdAt.getUTCMinutes().toString().length === 1)
creationMinutes = "0" + user.createdAt.getUTCMinutes()
else
creationMinutes = user.createdAt.getUTCMinutes()
if (user.createdAt.getUTCMinutes().toString().length === 1)
creationMinutes = "0" + user.createdAt.getUTCMinutes()
else
creationMinutes = user.createdAt.getUTCMinutes()
if (user.createdAt.getUTCSeconds().toString().length === 1)
creationSeconds = "0" + user.createdAt.getUTCSeconds()
else
creationSeconds = user.createdAt.getUTCSeconds()
if (user.createdAt.getUTCSeconds().toString().length === 1)
creationSeconds = "0" + user.createdAt.getUTCSeconds()
else
creationSeconds = user.createdAt.getUTCSeconds()
let creation = `${user.createdAt.getUTCFullYear()}-${creationMonth}-${creationDate} ${creationHours}:${creationMinutes}:${creationSeconds}`
return { creation: creation }
let creation = `${user.createdAt.getUTCFullYear()}-${creationMonth}-${creationDate} ${creationHours}:${creationMinutes}:${creationSeconds}`
return { creation: creation }
}

View file

@ -3,17 +3,17 @@ const netloadDir = 'netload/'
module.exports = function (client) {
if (!fs.existsSync(netloadDir)) fs.mkdirSync(netloadDir);
let commandFiles = fs.readdirSync(netloadDir).filter(file => file.endsWith('.js'));
if (client.netmodules.size != 0) {
for (const i of commandFiles) {
delete require.cache[require.resolve(`../${netloadDir}${i}`)];
}
}
client.netmodules.clear()
for (const file of commandFiles) {
const command = require(`../${netloadDir}${file}`);
client.netmodules.set(command.name, command);
}
if (!fs.existsSync(netloadDir)) fs.mkdirSync(netloadDir);
let commandFiles = fs.readdirSync(netloadDir).filter(file => file.endsWith('.js'));
if (client.netmodules.size != 0) {
for (const i of commandFiles) {
delete require.cache[require.resolve(`../${netloadDir}${i}`)];
}
}
client.netmodules.clear()
for (const file of commandFiles) {
const command = require(`../${netloadDir}${file}`);
client.netmodules.set(command.name, command);
}
}

View file

@ -2,17 +2,17 @@ const fs = require('fs')
module.exports = function (client) {
try {
if(!fs.existsSync('serverPrefixes.json')){
console.log("Creating loadServerPrefixes.json...")
fs.writeFileSync("serverPrefixes.json","[]")
}
const json = fs.readFileSync('serverPrefixes.json', 'utf8');
const serverPrefixes = JSON.parse(json);
serverPrefixes.forEach(server => {
client.serverPrefixes.set(server.id, server.prefix)
});
} catch (err) {
console.log(`Error reading file from disk: ${err}`);
}
try {
if(!fs.existsSync('serverPrefixes.json')){
console.log("Creating loadServerPrefixes.json...")
fs.writeFileSync("serverPrefixes.json","[]")
}
const json = fs.readFileSync('serverPrefixes.json', 'utf8');
const serverPrefixes = JSON.parse(json);
serverPrefixes.forEach(server => {
client.serverPrefixes.set(server.id, server.prefix)
});
} catch (err) {
console.log(`Error reading file from disk: ${err}`);
}
}

View file

@ -1,35 +1,35 @@
module.exports = function (text, guild) {
let id = "";
let ismention = false;
if (
text.substring(0, 2) == "<@" &&
text.substring(text.length - 1, text.length) == ">"
) {
let start = 2;
if (text.substring(0, 3) == "<@!") start = 3;
id = text.substring(start, text.length - 1);
ismention = true;
} else {
if (!isNaN(text)) {
id = text;
}
}
if (!ismention) {
guild.members.cache.each(function (guildMember, guildMemberID) {
let compare = text.toLowerCase();
if (guildMember.user.username.toLowerCase().includes(compare)) {
id = guildMemberID;
return;
}
if (guildMember.nickname) {
if (guildMember.nickname.toLowerCase().includes(compare)) {
id = guildMemberID;
return;
}
}
});
}
return id;
let id = "";
let ismention = false;
if (
text.substring(0, 2) == "<@" &&
text.substring(text.length - 1, text.length) == ">"
) {
let start = 2;
if (text.substring(0, 3) == "<@!") start = 3;
id = text.substring(start, text.length - 1);
ismention = true;
} else {
if (!isNaN(text)) {
id = text;
}
}
if (!ismention) {
guild.members.cache.each(function (guildMember, guildMemberID) {
let compare = text.toLowerCase();
if (guildMember.user.username.toLowerCase().includes(compare)) {
id = guildMemberID;
return;
}
if (guildMember.nickname) {
if (guildMember.nickname.toLowerCase().includes(compare)) {
id = guildMemberID;
return;
}
}
});
}
return id;
}

View file

@ -1,3 +1,3 @@
module.exports = function (min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
return Math.floor(Math.random() * (max - min + 1) + min);
}

View file

@ -4,20 +4,20 @@ const utilPath = 'util/'
module.exports = function (client) {
let utilFiles = fs.readdirSync(utilPath).filter(file => file.endsWith('.js'));
let commandFiles = fs.readdirSync(commandPath).filter(file => file.endsWith('.js'));
if (client.commands.size != 0) {
for (const i of commandFiles) {
delete require.cache[require.resolve(`../${commandPath}${i}`)];
}
for (const i of utilFiles){
delete require.cache[require.resolve(`../${utilPath}${i}`)]
}
}
client.commands.clear()
for (const file of commandFiles) {
const command = require(`../${commandPath}${file}`);
client.commands.set(command.name, command);
}
let utilFiles = fs.readdirSync(utilPath).filter(file => file.endsWith('.js'));
let commandFiles = fs.readdirSync(commandPath).filter(file => file.endsWith('.js'));
if (client.commands.size != 0) {
for (const i of commandFiles) {
delete require.cache[require.resolve(`../${commandPath}${i}`)];
}
for (const i of utilFiles){
delete require.cache[require.resolve(`../${utilPath}${i}`)]
}
}
client.commands.clear()
for (const file of commandFiles) {
const command = require(`../${commandPath}${file}`);
client.commands.set(command.name, command);
}
}

View file

@ -2,24 +2,24 @@ const fs = require('fs');
module.exports = function (client, newPrefix, guildID) {
let isExists = false;
const json = fs.readFileSync('serverPrefixes.json', 'utf8');
const serverPrefixes = JSON.parse(json);
serverPrefixes.forEach(function (server) {
if (server.id === guildID) {
server.prefix = newPrefix
client.serverPrefixes.set(server.id, newPrefix)
fs.writeFileSync("serverPrefixes.json", JSON.stringify(serverPrefixes));
isExists = true;
}
});
if (!isExists) {
let _newPrefix = {
"id": guildID, "prefix": newPrefix
}
let isExists = false;
const json = fs.readFileSync('serverPrefixes.json', 'utf8');
const serverPrefixes = JSON.parse(json);
serverPrefixes.forEach(function (server) {
if (server.id === guildID) {
server.prefix = newPrefix
client.serverPrefixes.set(server.id, newPrefix)
fs.writeFileSync("serverPrefixes.json", JSON.stringify(serverPrefixes));
isExists = true;
}
});
if (!isExists) {
let _newPrefix = {
"id": guildID, "prefix": newPrefix
}
serverPrefixes.push(_newPrefix)
fs.writeFileSync("serverPrefixes.json", JSON.stringify(serverPrefixes))
client.serverPrefixes.set(guildID, newPrefix)
}
serverPrefixes.push(_newPrefix)
fs.writeFileSync("serverPrefixes.json", JSON.stringify(serverPrefixes))
client.serverPrefixes.set(guildID, newPrefix)
}
}