forked from Galactic/galactic-bot
missing stuff
This commit is contained in:
parent
14bfc137f3
commit
3b06edde70
@ -12,7 +12,8 @@ class MemberLog extends Setting {
|
||||
default: {
|
||||
channel: null,
|
||||
join: '{mention} joined the server.',
|
||||
leave: '**{tag}** ({id}) left the server.'
|
||||
leave: '**{tag}** ({id}) left the server.',
|
||||
enabled: false
|
||||
},
|
||||
definitions: {
|
||||
channel: 'GUILD_TEXT',
|
||||
@ -20,6 +21,11 @@ class MemberLog extends Setting {
|
||||
leave: 'STRING'
|
||||
},
|
||||
commandOptions: [
|
||||
new CommandOption({
|
||||
name: 'enabled',
|
||||
description: 'Enable/disable member logs',
|
||||
type: 'BOOLEAN'
|
||||
}),
|
||||
new CommandOption({
|
||||
name: 'channel',
|
||||
description: 'Select the log output channel',
|
||||
@ -45,6 +51,7 @@ class MemberLog extends Setting {
|
||||
if (opts.join) setting.join = opts.join.value;
|
||||
if (opts.leave) setting.join = opts.join.value;
|
||||
if (opts.channel) setting.channel = opts.channel.value.id;
|
||||
if (opts.enabled) setting.enabled = opts.enabled.value;
|
||||
|
||||
return { index: 'SETTING_SUCCESS_ALT' };
|
||||
|
||||
@ -54,6 +61,13 @@ class MemberLog extends Setting {
|
||||
|
||||
const setting = guild._settings[this.name];
|
||||
return [
|
||||
{
|
||||
name: 'GENERAL_STATUS',
|
||||
value: guild.format('GENERAL_STATE', {
|
||||
bool: Boolean(setting.enabled)
|
||||
}, { code: true }),
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
name: 'GENERAL_CHANNEL',
|
||||
value: setting.channel ? `<#${setting.channel}>` : '**N/A**',
|
||||
|
@ -44,6 +44,11 @@ class ModerationLog extends Setting {
|
||||
}
|
||||
},
|
||||
commandOptions: [
|
||||
new CommandOption({
|
||||
name: 'enabled',
|
||||
description: 'Enable/disable member logs',
|
||||
type: 'BOOLEAN'
|
||||
}),
|
||||
new CommandOption({
|
||||
name: 'channel',
|
||||
description: 'Logging channel',
|
||||
@ -71,12 +76,13 @@ class ModerationLog extends Setting {
|
||||
|
||||
async execute(interaction, opts, setting) {
|
||||
|
||||
const { channel, infractions, anonymous } = opts,
|
||||
const { channel, infractions, anonymous, enabled } = opts,
|
||||
langParams = {};
|
||||
let index = 'SETTING_SUCCESS_ALT';
|
||||
|
||||
if (anonymous) setting.anonymous = anonymous.value;
|
||||
if (channel) setting.channel = channel.value.id;
|
||||
if (enabled) setting.enabled = enabled.value;
|
||||
|
||||
if (infractions) {
|
||||
const response = await this._prompt(interaction, {
|
||||
@ -108,7 +114,7 @@ class ModerationLog extends Setting {
|
||||
return [
|
||||
{
|
||||
name: 'GENERAL_STATUS',
|
||||
value: guild.format('GENERAL_STATE', { bool: Boolean(setting.channel) }, { code: true }),
|
||||
value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }),
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
|
@ -9,12 +9,18 @@ class Nicknames extends Setting {
|
||||
display: 'Nickname Logging',
|
||||
module: 'logging',
|
||||
default: {
|
||||
channel: null
|
||||
channel: null,
|
||||
enabled: false
|
||||
},
|
||||
definitions: {
|
||||
channel: 'GUILD_TEXT'
|
||||
},
|
||||
commandOptions: [
|
||||
new CommandOption({
|
||||
name: 'enabled',
|
||||
description: 'Toggle logging on or off',
|
||||
type: 'BOOLEAN'
|
||||
}),
|
||||
new CommandOption({
|
||||
name: 'channel',
|
||||
type: 'TEXT_CHANNEL',
|
||||
@ -26,7 +32,9 @@ class Nicknames extends Setting {
|
||||
|
||||
async execute(interaction, opts, setting) {
|
||||
|
||||
setting.channel = opts.channel.value.id;
|
||||
if (opts.enabled) setting.enabled = opts.enabled.value;
|
||||
if (opts.channel) setting.channel = opts.channel.value.id;
|
||||
|
||||
return { index: 'SETTING_SUCCESS_ALT' };
|
||||
|
||||
}
|
||||
@ -36,7 +44,7 @@ class Nicknames extends Setting {
|
||||
return [
|
||||
{
|
||||
name: 'GENERAL_STATUS',
|
||||
value: guild.format('GENERAL_STATE', { bool: Boolean(setting.channel) }, { code: true }),
|
||||
value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }),
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
|
@ -15,6 +15,11 @@ class Voice extends Setting {
|
||||
channel: 'GUILD_TEXT'
|
||||
},
|
||||
commandOptions: [
|
||||
new CommandOption({
|
||||
name: 'enabled',
|
||||
description: 'Toggle logging on or off',
|
||||
type: 'BOOLEAN'
|
||||
}),
|
||||
new CommandOption({
|
||||
name: 'channel',
|
||||
type: 'TEXT_CHANNEL',
|
||||
@ -26,7 +31,9 @@ class Voice extends Setting {
|
||||
|
||||
async execute(interaction, opts, setting) {
|
||||
|
||||
setting.channel = opts.channel.value.id;
|
||||
if (opts.enabled) setting.enabled = opts.enabled.value;
|
||||
if (opts.channel) setting.channel = opts.channel.value.id;
|
||||
|
||||
return { index: 'SETTING_SUCCESS_ALT' };
|
||||
|
||||
}
|
||||
@ -36,7 +43,7 @@ class Voice extends Setting {
|
||||
return [
|
||||
{
|
||||
name: 'GENERAL_STATUS',
|
||||
value: guild.format('GENERAL_STATE', { bool: Boolean(setting.channel) }, { code: true }),
|
||||
value: guild.format('GENERAL_STATE', { bool: Boolean(setting.enabled) }, { code: true }),
|
||||
inline: true
|
||||
},
|
||||
{
|
||||
|
@ -307,6 +307,7 @@ class SettingsMigrator {
|
||||
};
|
||||
|
||||
if (memberlogs) settings.members = {
|
||||
enabled: result.memberlogs?.enabled || false,
|
||||
channel: result.memberlogs?.channel || null,
|
||||
join: result.memberlogs?.join || '{mention} joined the server.',
|
||||
leave: result.memberlogs?.leave || '**{tag}** ({id}) left the server.'
|
||||
|
Loading…
Reference in New Issue
Block a user