Ticket creation

This commit is contained in:
Isaac
2021-03-28 23:49:36 +01:00
parent 91c53f38e6
commit 82c3175f37
8 changed files with 135 additions and 55 deletions

View File

@@ -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
};
});

View File

@@ -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');
}
};