Add new member channel setting
This commit is contained in:
@@ -40,6 +40,12 @@ export default {
|
|||||||
.setDescription('Set the voice logs channel.')
|
.setDescription('Set the voice logs channel.')
|
||||||
.setRequired(false)
|
.setRequired(false)
|
||||||
)
|
)
|
||||||
|
.addChannelOption(option =>
|
||||||
|
option
|
||||||
|
.setName('new-member-channel')
|
||||||
|
.setDescription('Set the new member logs channel.')
|
||||||
|
.setRequired(false)
|
||||||
|
)
|
||||||
.addRoleOption(option =>
|
.addRoleOption(option =>
|
||||||
option
|
option
|
||||||
.setName('admin-role')
|
.setName('admin-role')
|
||||||
@@ -115,6 +121,14 @@ export default {
|
|||||||
response += `Voice logs channel set to ${voiceLogsChannel}.\n`;
|
response += `Voice logs channel set to ${voiceLogsChannel}.\n`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const newMemberLogsChannel = interaction.options.getChannel('new-member-channel');
|
||||||
|
|
||||||
|
if (newMemberLogsChannel) {
|
||||||
|
await Database.setGuildNewMemberLogsChannel(interaction.guildId!, newMemberLogsChannel.id);
|
||||||
|
|
||||||
|
response += `New member logs channel set to ${newMemberLogsChannel}.\n`;
|
||||||
|
}
|
||||||
|
|
||||||
const adminRole = interaction.options.getRole('admin-role');
|
const adminRole = interaction.options.getRole('admin-role');
|
||||||
|
|
||||||
if (adminRole) {
|
if (adminRole) {
|
||||||
|
|||||||
@@ -147,6 +147,10 @@ export class Database {
|
|||||||
await Database.db.run('UPDATE settings SET voice_logs_channel_id = ? WHERE guild_id = ?', id, guildId);
|
await Database.db.run('UPDATE settings SET voice_logs_channel_id = ? WHERE guild_id = ?', id, guildId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async setGuildNewMemberLogsChannel(guildId: string, id: string) {
|
||||||
|
await Database.db.run('UPDATE settings SET new_member_channel_id = ? WHERE guild_id = ?', id, guildId);
|
||||||
|
}
|
||||||
|
|
||||||
static async setGuildAdminRole(guildId: string, id: string) {
|
static async setGuildAdminRole(guildId: string, id: string) {
|
||||||
await Database.db.run('UPDATE settings SET admin_role_id = ? WHERE guild_id = ?', id, guildId);
|
await Database.db.run('UPDATE settings SET admin_role_id = ? WHERE guild_id = ?', id, guildId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user