Compare commits

...

3 commits

Author SHA1 Message Date
Ethan Lane 99c889b82c Merge branch 'develop' into feature/315-config-value-undefined
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2023-09-29 11:43:45 +01:00
Ethan Lane 7613aedbbe Fix muted command not working (#335)
Some checks failed
continuous-integration/drone/push Build is failing
# Description

- Fix muted command not working
- This was caused by the muted role name still using old logic before per-server configuration

#316

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)

# How Has This Been Tested?

- This was tested locally by running the mute and unmute commands, and seeing it the error no longer occurs

# Checklist

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that provde my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules

Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/335
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
2023-08-18 21:07:19 +01:00
Ethan Lane 1c4fdd05f1 Fix config get command not returning the right key value name (#334)
Some checks failed
continuous-integration/drone/push Build is failing
# Description

- Fixed the `/config get` command not returning the actual key's name, instead using a strinified "Object" property

#289

## Type of change

Please delete options that are not relevant.

- [x] Bug fix (non-breaking change which fixes an issue)

# How Has This Been Tested?

- This was tested by running the `/config get` command on my dev bot, and making sure it still gets the correct value for the key string

# Checklist

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that provide my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published in downstream modules

Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/vylbot-app/pulls/334
Co-authored-by: Ethan Lane <ethan@vylpes.com>
Co-committed-by: Ethan Lane <ethan@vylpes.com>
2023-08-18 21:04:06 +01:00
3 changed files with 18 additions and 4 deletions

View file

@ -116,7 +116,7 @@ export default class Config extends Command {
const setting = server.Settings.filter(x => x.Key == key.value)[0];
if (setting) {
await interaction.reply(`\`${key}\`: \`${setting.Value}\``);
await interaction.reply(`\`${key.value}\`: \`${setting.Value}\``);
} else {
var defaultValue = DefaultValues.GetValue(key.value.toString());
@ -197,4 +197,4 @@ export default class Config extends Command {
await interaction.reply('Setting has been set.');
}
}
}

View file

@ -54,7 +54,14 @@ export default class Mute extends Command {
},
]);
const mutedRole = interaction.guild.roles.cache.find(role => role.name == process.env.ROLES_MUTED);
const mutedRoleName = await SettingsHelper.GetSetting('role.muted', interaction.guildId);
if (!mutedRoleName) {
await interaction.reply('Unable to find configuration. Please contact the bot author.');
return;
}
const mutedRole = interaction.guild.roles.cache.find(role => role.name == mutedRoleName);
if (!mutedRole) {
await interaction.reply('Muted role not found.');

View file

@ -52,7 +52,14 @@ export default class Unmute extends Command {
},
]);
const mutedRole = interaction.guild.roles.cache.find(role => role.name == process.env.ROLES_MUTED);
const mutedRoleName = await SettingsHelper.GetSetting('role.muted', interaction.guildId);
if (!mutedRoleName) {
await interaction.reply('Unable to find configuration. Please contact the bot author.');
return;
}
const mutedRole = interaction.guild.roles.cache.find(role => role.name == mutedRoleName);
if (!mutedRole) {
await interaction.reply('Muted role not found.');