.qimport will is no longer owner only on the public bot

Creds issues should now be properly caught and logged, instead of showing unhandled exceptions
This commit is contained in:
Toastie 2024-09-11 20:41:00 +12:00
parent 140a35b82a
commit 78366ab7e4
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
4 changed files with 12 additions and 13 deletions

1
.gitignore vendored
View file

@ -21,6 +21,7 @@ src/EllieBot/old_credentials.json
src/EllieBot/credentials.json.bak
src/EllieBot/data/EllieBot.db
ellie-menu.ps1
package.sh
# Created by https://www.gitignore.io/api/visualstudio,visualstudiocode,windows,linux,macos

View file

@ -401,6 +401,7 @@ public partial class EllieExpressions : EllieModule<EllieExpressionsService>
}
[Cmd]
[Ratelimit(300)]
public async Task ExprsImport([Leftover] string input = null)
{
// todo cooldown on public bot for 1 day, limit 100

View file

@ -351,9 +351,6 @@ public partial class Utility
[RequireContext(ContextType.Guild)]
[UserPerm(GuildPerm.Administrator)]
[Ratelimit(300)]
#if GLOBAL_NADEKO
[OwnerOnly]
#endif
public async Task QuotesImport([Leftover] string? input = null)
{
input = input?.Trim();

View file

@ -49,6 +49,8 @@ public sealed class BotCredsProvider : IBotCredsProvider
// this can fail in docker containers
}
try
{
MigrateCredentials();
if (!File.Exists(CredsPath))
@ -59,8 +61,6 @@ public sealed class BotCredsProvider : IBotCredsProvider
CredsExamplePath);
}
try
{
_config = new ConfigurationBuilder().AddYamlFile(CredsPath, false, true)
.AddEnvironmentVariables("EllieBot_")
.Build();