initial commit
This commit is contained in:
14 files changed
+3067
No files matched your search
@@ -0,0 +1,3 @@
|
||||
module.exports = (client, guild) => {
|
||||
require("../util/RegisterSlashCommands")(client, guild.id);
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
*
|
||||
* @param {require("../structures/QuarksBot")} client
|
||||
* @param {require("discord.js").message} message
|
||||
* @returns {void} or nothing if you didn't know
|
||||
*/
|
||||
|
||||
module.exports = async (client, message) => {
|
||||
if (message.author.bot || message.channel.type === "dm") return;
|
||||
|
||||
let GuildDB = await client.GetGuild(message.guild.id);
|
||||
|
||||
//Prefixes also have mention match
|
||||
const prefixMention = new RegExp(`^<@!?${client.user.id}> `);
|
||||
prefix = message.content.match(prefixMention);
|
||||
|
||||
if (message.content.indexOf(prefix) !== 0) return;
|
||||
|
||||
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(message.channel.id)) {
|
||||
return message.channel.send(`You are not allowed to use the bot in this channel.`);
|
||||
}
|
||||
|
||||
const args = message.content.slice(prefix.length).trim().split(/ +/g);
|
||||
//Making the command lowerCase because our file name will be in lowerCase
|
||||
const command = args.shift().toLowerCase();
|
||||
|
||||
//Searching a command
|
||||
const cmd =
|
||||
client.commands.get(command) ||
|
||||
client.commands.find((x) => x.aliases && x.aliases.includes(command));
|
||||
|
||||
//Executing the codes when we get the command or aliases
|
||||
if (cmd) {
|
||||
if (
|
||||
(cmd.permissions &&
|
||||
cmd.permissions.channel &&
|
||||
!message.channel
|
||||
.permissionsFor(client.user)
|
||||
.has(cmd.permissions.channel)) ||
|
||||
(cmd.permissions &&
|
||||
cmd.permissions.member &&
|
||||
!message.channel
|
||||
.permissionsFor(message.member)
|
||||
.has(cmd.permissions.member))
|
||||
)
|
||||
return client.sendError(
|
||||
message.channel,
|
||||
"Missing Permissions!" + GuildDB.DJ
|
||||
? " You need the correct role to access this command."
|
||||
: ""
|
||||
);
|
||||
cmd.run(client, message, args, { GuildDB });
|
||||
client.CommandsRan++;
|
||||
} else return;
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
module.exports = async (client) => {
|
||||
(client.Ready = true),
|
||||
client.user.setActivity(client.config.Presence.name, {
|
||||
type: client.config.Presence.type,
|
||||
})
|
||||
client.user.setPresence({
|
||||
status: client.config.Presence.status, // You can show online, idle, and dnd
|
||||
});
|
||||
client.log(`Successfully Logged in as ${client.user.tag}`); // You can change the text if you want, but DO NOT REMOVE "client.user.tag"
|
||||
client.log(`Ready to serve in ${client.channels.cache.size} channels on ${client.guilds.cache.size} servers, for a total of ${client.users.cache.size} users.`)
|
||||
client.RegisterSlashCommands();
|
||||
};
|
||||
Reference in new issue
Block a user