mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2025-09-10 09:18:27 -04:00
change: .qimport will is no longer owner only on the public bot
dev: Creds issues should now be properly caught and logged, instead of showing unhandled exceptions
This commit is contained in:
@@ -402,6 +402,7 @@ public partial class NadekoExpressions : NadekoModule<NadekoExpressionsService>
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Cmd]
|
[Cmd]
|
||||||
|
[Ratelimit(300)]
|
||||||
public async Task ExprsImport([Leftover] string input = null)
|
public async Task ExprsImport([Leftover] string input = null)
|
||||||
{
|
{
|
||||||
// todo cooldown on public bot for 1 day, limit 100
|
// todo cooldown on public bot for 1 day, limit 100
|
||||||
|
@@ -351,9 +351,6 @@ public partial class Utility
|
|||||||
[RequireContext(ContextType.Guild)]
|
[RequireContext(ContextType.Guild)]
|
||||||
[UserPerm(GuildPerm.Administrator)]
|
[UserPerm(GuildPerm.Administrator)]
|
||||||
[Ratelimit(300)]
|
[Ratelimit(300)]
|
||||||
#if GLOBAL_NADEKO
|
|
||||||
[OwnerOnly]
|
|
||||||
#endif
|
|
||||||
public async Task QuotesImport([Leftover] string? input = null)
|
public async Task QuotesImport([Leftover] string? input = null)
|
||||||
{
|
{
|
||||||
input = input?.Trim();
|
input = input?.Trim();
|
||||||
|
@@ -49,18 +49,19 @@ public sealed class BotCredsProvider : IBotCredsProvider
|
|||||||
// this can fail in docker containers
|
// 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 'NadekoBot_'. Example is in {CredsExamplePath}",
|
|
||||||
CredsPath,
|
|
||||||
CredsExamplePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
MigrateCredentials();
|
||||||
|
|
||||||
|
if (!File.Exists(CredsPath))
|
||||||
|
{
|
||||||
|
Log.Warning(
|
||||||
|
"{CredsPath} is missing. Attempting to load creds from environment variables prefixed with 'NadekoBot_'. Example is in {CredsExamplePath}",
|
||||||
|
CredsPath,
|
||||||
|
CredsExamplePath);
|
||||||
|
}
|
||||||
|
|
||||||
_config = new ConfigurationBuilder().AddYamlFile(CredsPath, false, true)
|
_config = new ConfigurationBuilder().AddYamlFile(CredsPath, false, true)
|
||||||
.AddEnvironmentVariables("NadekoBot_")
|
.AddEnvironmentVariables("NadekoBot_")
|
||||||
.Build();
|
.Build();
|
||||||
@@ -141,6 +142,7 @@ public sealed class BotCredsProvider : IBotCredsProvider
|
|||||||
{
|
{
|
||||||
creds.BotCache = BotCacheImplemenation.Redis;
|
creds.BotCache = BotCacheImplemenation.Redis;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (creds.Version <= 6)
|
if (creds.Version <= 6)
|
||||||
{
|
{
|
||||||
creds.Version = 7;
|
creds.Version = 7;
|
||||||
|
Reference in New Issue
Block a user