mirror of
https://github.com/Hessenuk/DiscordTickets.git
synced 2024-12-23 08:13:09 +02:00
settings command stuff
This commit is contained in:
parent
ffc415354a
commit
dfb3f1ca02
@ -68,13 +68,13 @@ module.exports = class SettingsCommand extends Command {
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// create a new category
|
// create a new category
|
||||||
let created = await guild.channels.create(c.name, {
|
let cat_channel = await guild.channels.create(c.name, {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
reason: `Tickets category created by ${member.user.tag}`,
|
reason: `Tickets category created by ${member.user.tag}`,
|
||||||
permissionOverwrites: permissions
|
permissionOverwrites: permissions
|
||||||
});
|
});
|
||||||
await this.client.db.models.Category.create({
|
await this.client.db.models.Category.create({
|
||||||
id: created.id,
|
id: cat_channel.id,
|
||||||
name: c.name,
|
name: c.name,
|
||||||
guild: guild.id,
|
guild: guild.id,
|
||||||
roles: c.roles
|
roles: c.roles
|
||||||
@ -82,7 +82,7 @@ module.exports = class SettingsCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
channel.send(`\`\`\`json\n${JSON.stringify(data, null, 2)}\n\`\`\``);
|
channel.send(i18n('commands.settings.response.updated'));
|
||||||
} else {
|
} else {
|
||||||
// upload settings as json to be modified
|
// upload settings as json to be modified
|
||||||
let data = {
|
let data = {
|
||||||
@ -100,20 +100,21 @@ module.exports = class SettingsCommand extends Command {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
for (let c of categories) {
|
data.categories = categories.map(c =>{
|
||||||
data.categories.push({
|
return {
|
||||||
id: c.id,
|
id: c.id,
|
||||||
name: c.name,
|
name: c.name,
|
||||||
roles: c.roles
|
roles: c.roles
|
||||||
});
|
};
|
||||||
}
|
});
|
||||||
|
console.log(data)
|
||||||
|
|
||||||
let attachment = new MessageAttachment(
|
let attachment = new MessageAttachment(
|
||||||
Buffer.from(JSON.stringify(data, null, 2)),
|
Buffer.from(JSON.stringify(data, null, 2)),
|
||||||
`Settings for ${guild.name}.json`
|
`Settings for ${guild.name}.json`
|
||||||
);
|
);
|
||||||
|
|
||||||
channel.send(i18n('commands.settings.response'), {
|
channel.send({
|
||||||
files: [attachment]
|
files: [attachment]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,10 @@
|
|||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"name": "settings",
|
"name": "settings",
|
||||||
"description": "Configure Discord Tickets"
|
"description": "Configure Discord Tickets",
|
||||||
|
"response": {
|
||||||
|
"updated": "✅ Settings have been updated."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"must_be_slash": "❌ This command must be invoked by a slash command interaction (`/%s`).",
|
"must_be_slash": "❌ This command must be invoked by a slash command interaction (`/%s`).",
|
||||||
|
Loading…
Reference in New Issue
Block a user