mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-02 08:41:25 +03:00
update
This commit is contained in:
22
commands/add.js
Normal file
22
commands/add.js
Normal 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
22
commands/close.js
Normal 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
|
||||
},
|
||||
};
|
@@ -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
|
||||
|
@@ -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);
|
||||
|
@@ -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
29
commands/ping.js
Normal 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
22
commands/remove.js
Normal 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
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user