.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:
parent
140a35b82a
commit
78366ab7e4
4 changed files with 12 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -49,18 +49,18 @@ public sealed class BotCredsProvider : IBotCredsProvider
|
|||
// this can fail in docker containers
|
||||
}
|
||||
|
||||
MigrateCredentials();
|
||||
|
||||
if (!File.Exists(CredsPath))
|
||||
{
|
||||
Log.Warning(
|
||||
"{CredsPath} is missing. Attempting to load creds from environment variables prefixed with 'EllieBot_'. Example is in {CredsExamplePath}",
|
||||
CredsPath,
|
||||
CredsExamplePath);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
MigrateCredentials();
|
||||
|
||||
if (!File.Exists(CredsPath))
|
||||
{
|
||||
Log.Warning(
|
||||
"{CredsPath} is missing. Attempting to load creds from environment variables prefixed with 'EllieBot_'. Example is in {CredsExamplePath}",
|
||||
CredsPath,
|
||||
CredsExamplePath);
|
||||
}
|
||||
|
||||
_config = new ConfigurationBuilder().AddYamlFile(CredsPath, false, true)
|
||||
.AddEnvironmentVariables("EllieBot_")
|
||||
.Build();
|
||||
|
|
Loading…
Reference in a new issue