mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-11-04 20:03:09 +02:00
update
This commit is contained in:
parent
ddbc940bd5
commit
b32d038e0b
21
commands/example-command.js.example
Normal file
21
commands/example-command.js.example
Normal file
@ -0,0 +1,21 @@
|
||||
const Discord = require('discord.js');
|
||||
const config = require('../config.json');
|
||||
module.exports = {
|
||||
name: 'example-command',
|
||||
description: 'An example command',
|
||||
usage: '[args]',
|
||||
aliases: ['command', 'commands'],
|
||||
example: 'example-command',
|
||||
args: false,
|
||||
cooldown: config.cooldown,
|
||||
execute(message, args) {
|
||||
const client = message.client;
|
||||
// command starts here
|
||||
message.delete();
|
||||
|
||||
|
||||
|
||||
|
||||
// command ends here
|
||||
},
|
||||
};
|
@ -6,6 +6,7 @@ module.exports = {
|
||||
description: 'Displays help menu',
|
||||
usage: '[command]',
|
||||
aliases: ['command', 'commands'],
|
||||
example: 'help new',
|
||||
args: false,
|
||||
cooldown: config.cooldown,
|
||||
execute(message, args) {
|
||||
|
@ -1,9 +1,13 @@
|
||||
const Discord = require('discord.js');
|
||||
const config = require('../config.json');
|
||||
module.exports = {
|
||||
name: 'new',
|
||||
description: 'Create a new ticket',
|
||||
usage: '<brief description>',
|
||||
aliases: ['ticket'],
|
||||
example: 'new I found an error',
|
||||
args: true,
|
||||
cooldown: config.cooldown,
|
||||
execute(message, args) {
|
||||
// command starts here
|
||||
message.delete();
|
||||
|
@ -10,5 +10,5 @@
|
||||
"playing": "with tickets (!help)",
|
||||
"useEmbeds": true,
|
||||
"logDMs": true,
|
||||
"cooldown": 3
|
||||
"cooldown": 5
|
||||
}
|
||||
|
12
index.js
12
index.js
@ -201,7 +201,17 @@ client.on('message', message => {
|
||||
|
||||
if (now < expirationTime) {
|
||||
const timeLeft = (expirationTime - now) / 1000;
|
||||
return message.reply(`please wait ${timeLeft.toFixed(1)} more second(s) before reusing the \`${command.name}\` command.`);
|
||||
if (config.useEmbeds) {
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setAuthor(`${client.user.username}`, client.user.avatarURL)
|
||||
.setColor("#E74C3C")
|
||||
.setDescription(`:x: **Please do not spam commands** (wait ${timeLeft.toFixed(1)}s)`)
|
||||
.setFooter(`${client.guilds.get(config.guildID).name} : DiscordTickets by Eartharoid`);
|
||||
return message.channel.send({embed})
|
||||
} else {
|
||||
return message.reply(`please do not spam commands (wait ${timeLeft.toFixed(1)}s)`);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
timestamps.set(message.author.id, now);
|
||||
|
Loading…
Reference in New Issue
Block a user