mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2025-09-06 10:11:27 +03:00
Ticket creation
This commit is contained in:
@@ -44,6 +44,8 @@ module.exports = class SettingsCommand extends Command {
|
||||
});
|
||||
category.name = c.name;
|
||||
category.roles = c.roles;
|
||||
category.max_per_member = c.max_per_member;
|
||||
category.name_format = c.name_format;
|
||||
category.save();
|
||||
|
||||
let cat_channel = await this.client.channels.fetch(c.id);
|
||||
@@ -67,6 +69,7 @@ module.exports = class SettingsCommand extends Command {
|
||||
let cat_channel = await guild.channels.create(c.name, {
|
||||
type: 'category',
|
||||
reason: `Tickets category created by ${member.user.tag}`,
|
||||
position: 0,
|
||||
permissionOverwrites: [
|
||||
...[
|
||||
{
|
||||
@@ -88,9 +91,11 @@ module.exports = class SettingsCommand extends Command {
|
||||
});
|
||||
await this.client.db.models.Category.create({
|
||||
id: cat_channel.id,
|
||||
max_per_member: c.max_per_member,
|
||||
name: c.name,
|
||||
name_format: c.name_format,
|
||||
guild: guild.id,
|
||||
roles: c.roles
|
||||
roles: c.roles,
|
||||
});
|
||||
|
||||
}
|
||||
@@ -119,7 +124,9 @@ module.exports = class SettingsCommand extends Command {
|
||||
data.categories = categories.map(c =>{
|
||||
return {
|
||||
id: c.id,
|
||||
max_per_member: c.max_per_member,
|
||||
name: c.name,
|
||||
name_format: c.name_format,
|
||||
roles: c.roles
|
||||
};
|
||||
});
|
||||
|
@@ -9,6 +9,7 @@ module.exports = class NewCommand extends Command {
|
||||
internal: true,
|
||||
name: i18n('commands.new.name'),
|
||||
description: i18n('commands.new.description'),
|
||||
// slash: false,
|
||||
options: [
|
||||
{
|
||||
name: i18n('commands.new.options.category.name'),
|
||||
@@ -37,5 +38,8 @@ module.exports = class NewCommand extends Command {
|
||||
.setTitle(i18n('bot.version', require('../../package.json').version))
|
||||
.setDescription(args.topic)
|
||||
);
|
||||
|
||||
// this.client.tickets.create(guild.id, member.id, args.category, args.topic);
|
||||
this.client.tickets.create(guild.id, member.id, '825861413687787560');
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user