New stuff
This commit is contained in:
parent
0690d8fa0e
commit
954c687084
39 changed files with 4797 additions and 3799 deletions
events/discord
15
events/discord/interactionCreate.js
Normal file
15
events/discord/interactionCreate.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
module.exports = (client, interaction) => {
|
||||
// Check if our interaction is a slash command
|
||||
if (interaction.isCommand()) {
|
||||
// Get the command from our slash command collection
|
||||
const command = client.interactions.get(interaction.commandName);
|
||||
|
||||
// If command does not exist return an error message
|
||||
if (!command) return interaction.reply({
|
||||
content: "Something Went Wrong | Perhaps command not registered?",
|
||||
ephemeral: true
|
||||
});
|
||||
|
||||
command.run(client, interaction);
|
||||
}
|
||||
}
|
20
events/discord/messageCreate.js
Normal file
20
events/discord/messageCreate.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
module.exports = (client, message) => {
|
||||
// return if author is a bot
|
||||
if (message.author.bot) return;
|
||||
|
||||
// return if message does not match prefix (in command)
|
||||
if (message.content.indexOf(client.config.prefix) !== 0) return;
|
||||
|
||||
// Defining what are arguments and commands
|
||||
const args = message.content.slice(client.config.prefix.length).trim().split(/ +/g);
|
||||
const command = args.shift().toLowerCase();
|
||||
|
||||
// Get the command data from the client.commands Enmap
|
||||
const cmd = client.commands.get(command);
|
||||
|
||||
// If command does not exist return
|
||||
if (!cmd) return;
|
||||
|
||||
// Run the command
|
||||
cmd.run(client, message, args);
|
||||
};
|
53
events/discord/ready.js
Normal file
53
events/discord/ready.js
Normal file
|
@ -0,0 +1,53 @@
|
|||
const register = require('../../utils/slashsync');
|
||||
const { ActivityType } = require('discord.js');
|
||||
|
||||
module.exports = async (client) => {
|
||||
|
||||
await register(client, client.register_arr.map((command) => ({
|
||||
name: command.name,
|
||||
description: command.description,
|
||||
options: command.options,
|
||||
type: '1'
|
||||
})), {
|
||||
debug: true
|
||||
});
|
||||
|
||||
console.log(`[ / | Slash Command ] - ✅ Loaded all slash commands!`)
|
||||
console.log(`[STATUS] ${client.user.tag} is now online!`);
|
||||
const activities = [
|
||||
'Your Giveaways',
|
||||
'/help',
|
||||
'www.elliebot.net'
|
||||
]
|
||||
|
||||
setInterval(() => {
|
||||
const status = activities[Math.floor(Math.random() * activities.length)];
|
||||
client.user.setActivity({ name: `${status}`, type: ActivityType.Watching })
|
||||
}, 5000);
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Do this one if you want the streaming Status //
|
||||
|
||||
/*
|
||||
const register = require('../../utils/slashsync');
|
||||
const { ActivityType } = require('discord.js');
|
||||
|
||||
module.exports = async (client) => {
|
||||
|
||||
await register(client, client.register_arr.map((command) => ({
|
||||
name: command.name,
|
||||
description: command.description,
|
||||
options: command.options,
|
||||
type: '1'
|
||||
})), {
|
||||
debug: true
|
||||
});
|
||||
|
||||
console.log(`[ / | Slash Command ] - ✅ Loaded all slash commands!`)
|
||||
console.log(`[STATUS] ${client.user.tag} is now online!`);
|
||||
|
||||
client.user.setActivity({ name: `Your Giveaways`, type: ActivityType.Streaming, url: 'https://youtube.com/' })
|
||||
|
||||
};*/
|
Loading…
Add table
Add a link
Reference in a new issue