This commit is contained in:
Eartharoid
2019-05-04 16:09:05 +01:00
parent f9a725d81a
commit d005cc48d1
10 changed files with 122 additions and 7 deletions

22
commands/add.js Normal file
View File

@@ -0,0 +1,22 @@
const Discord = require('discord.js');
const config = require('../config.json');
module.exports = {
name: 'add',
description: 'Add a member to a ticket channel',
usage: '<@member>',
aliases: ['adduser'],
example: 'add @exampleUser',
args: false,
cooldown: config.cooldown,
guildOnly: true,
execute(message, args) {
const client = message.client;
// command starts here
message.delete();
// command ends here
},
};

22
commands/close.js Normal file
View File

@@ -0,0 +1,22 @@
const Discord = require('discord.js');
const config = require('../config.json');
module.exports = {
name: 'close',
description: 'Close a ticket',
usage: '',
aliases: ['none'],
example: '',
args: false,
cooldown: config.cooldown,
guildOnly: true,
execute(message, args) {
const client = message.client;
// command starts here
message.delete();
// command ends here
},
};

View File

@@ -4,10 +4,11 @@ module.exports = {
name: 'example-command',
description: 'An example command',
usage: '[args]',
aliases: ['command', 'commands'],
aliases: ['none'],
example: 'example-command',
args: false,
cooldown: config.cooldown,
guildOnly: true,
execute(message, args) {
const client = message.client;
// command starts here

View File

@@ -9,6 +9,7 @@ module.exports = {
example: 'help new',
args: false,
cooldown: config.cooldown,
guildOnly: true,
execute(message, args) {
const client = message.client;
// command starts here
@@ -65,6 +66,7 @@ module.exports = {
const cmd = new Discord.RichEmbed()
.setAuthor(`${client.user.username} / Commands`, client.user.avatarURL)
.setColor(config.colour)
.addField(`Command`,`\`${command.name}\``, true)
.setFooter(`${client.guilds.get(config.guildID).name} : DiscordTickets by Eartharoid`);
if (command.aliases) cmd.addField("Aliases", `\`${command.aliases.join(', ')}\``, true);

View File

@@ -1,5 +1,6 @@
const Discord = require('discord.js');
const config = require('../config.json');
const randomString = require('random-string');
module.exports = {
name: 'new',
description: 'Create a new ticket',
@@ -8,11 +9,22 @@ module.exports = {
example: 'new I found an error',
args: true,
cooldown: config.cooldown,
guildOnly: true,
execute(message, args) {
const client = message.client;
// command starts here
message.delete();
const ticketChannel = "channel";
let topic = args.join(" ");
function num(){
return randomString({
length: 4,
numeric: true,
letters: false,
special: false,
})
};
// log
if(config.useEmbeds) {

29
commands/ping.js Normal file
View File

@@ -0,0 +1,29 @@
const Discord = require('discord.js');
const config = require('../config.json');
module.exports = {
name: 'ping',
description: 'Calculate latency',
usage: '',
aliases: ['none'],
example: '',
args: false,
cooldown: config.cooldown,
guildOnly: true,
execute(message, args) {
const client = message.client;
// command starts here
message.delete();
const embed = new Discord.RichEmbed()
.setAuthor(`${client.user.username} / Pong!`, client.user.avatarURL)
.setColor(config.colour)
.setTimestamp()
.addField("API Latency", `${Math.round(message.client.ping)}ms`, true)
.setFooter(`${client.guilds.get(config.guildID).name} : DiscordTickets by Eartharoid`);
message.channel.send({embed})
// command ends here
},
};

22
commands/remove.js Normal file
View File

@@ -0,0 +1,22 @@
const Discord = require('discord.js');
const config = require('../config.json');
module.exports = {
name: 'remove',
description: 'Remove a member from a ticket',
usage: '<@member>',
aliases: ['kick'],
example: 'remove @exampleUser',
args: false,
cooldown: config.cooldown,
guildOnly: true,
execute(message, args) {
const client = message.client;
// command starts here
message.delete();
// command ends here
},
};