mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-22 15:53:08 +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',
|
description: 'Displays help menu',
|
||||||
usage: '[command]',
|
usage: '[command]',
|
||||||
aliases: ['command', 'commands'],
|
aliases: ['command', 'commands'],
|
||||||
|
example: 'help new',
|
||||||
args: false,
|
args: false,
|
||||||
cooldown: config.cooldown,
|
cooldown: config.cooldown,
|
||||||
execute(message, args) {
|
execute(message, args) {
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
|
const Discord = require('discord.js');
|
||||||
|
const config = require('../config.json');
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'new',
|
name: 'new',
|
||||||
description: 'Create a new ticket',
|
description: 'Create a new ticket',
|
||||||
usage: '<brief description>',
|
usage: '<brief description>',
|
||||||
aliases: ['ticket'],
|
aliases: ['ticket'],
|
||||||
|
example: 'new I found an error',
|
||||||
args: true,
|
args: true,
|
||||||
|
cooldown: config.cooldown,
|
||||||
execute(message, args) {
|
execute(message, args) {
|
||||||
// command starts here
|
// command starts here
|
||||||
message.delete();
|
message.delete();
|
||||||
|
@ -10,5 +10,5 @@
|
|||||||
"playing": "with tickets (!help)",
|
"playing": "with tickets (!help)",
|
||||||
"useEmbeds": true,
|
"useEmbeds": true,
|
||||||
"logDMs": true,
|
"logDMs": true,
|
||||||
"cooldown": 3
|
"cooldown": 5
|
||||||
}
|
}
|
||||||
|
12
index.js
12
index.js
@ -201,7 +201,17 @@ client.on('message', message => {
|
|||||||
|
|
||||||
if (now < expirationTime) {
|
if (now < expirationTime) {
|
||||||
const timeLeft = (expirationTime - now) / 1000;
|
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);
|
timestamps.set(message.author.id, now);
|
||||||
|
Loading…
Reference in New Issue
Block a user