diff --git a/src/NadekoBot/Modules/Administration/Commands/RatelimitCommand.cs b/src/NadekoBot/Modules/Administration/Commands/RatelimitCommand.cs index 2a4e111f..6d1e3f13 100644 --- a/src/NadekoBot/Modules/Administration/Commands/RatelimitCommand.cs +++ b/src/NadekoBot/Modules/Administration/Commands/RatelimitCommand.cs @@ -1,7 +1,10 @@ using Discord; using Discord.Commands; +using Microsoft.EntityFrameworkCore; using NadekoBot.Attributes; using NadekoBot.Extensions; +using NadekoBot.Services; +using NadekoBot.Services.Database; using NLog; using System; using System.Collections.Concurrent; @@ -118,6 +121,30 @@ namespace NadekoBot.Modules.Administration .ConfigureAwait(false); } } + + //[NadekoCommand, Usage, Description, Aliases] + //[RequireContext(ContextType.Guild)] + //[RequireUserPermission(GuildPermission.ManageMessages)] + //public async Task SlowmodeWhitelist(IUser user) + //{ + // Ratelimiter throwaway; + // if (RatelimitingChannels.TryRemove(Context.Channel.Id, out throwaway)) + // { + // throwaway.cancelSource.Cancel(); + // await ReplyConfirmLocalized("slowmode_disabled").ConfigureAwait(false); + // } + //} + + //[NadekoCommand, Usage, Description, Aliases] + //[RequireContext(ContextType.Guild)] + //[RequireUserPermission(GuildPermission.ManageMessages)] + //public async Task SlowmodeWhitelist(IRole role) + //{ + // using (var uow = DbHandler.UnitOfWork()) + // { + // uow.GuildConfigs.For(Context.Guild.Id, set => set.Include(x => x.SlowmodeWhitelists)). + // } + //} } } } \ No newline at end of file diff --git a/src/NadekoBot/Modules/Administration/Commands/SelfCommands.cs b/src/NadekoBot/Modules/Administration/Commands/SelfCommands.cs index 3af86611..09924682 100644 --- a/src/NadekoBot/Modules/Administration/Commands/SelfCommands.cs +++ b/src/NadekoBot/Modules/Administration/Commands/SelfCommands.cs @@ -36,11 +36,9 @@ namespace NadekoBot.Modules.Administration var _ = Task.Run(async () => { -#if !GLOBAL_NADEKO - await Task.Delay(2000); -#else - await Task.Delay(10000); -#endif + while(!NadekoBot.Ready) + await Task.Delay(1000); + foreach (var cmd in NadekoBot.BotConfig.StartupCommands) { if (cmd.GuildId != null) @@ -52,7 +50,8 @@ namespace NadekoBot.Modules.Administration try { - var msg = await channel.SendMessageAsync(cmd.CommandText).ConfigureAwait(false); + IUserMessage msg = await channel.SendMessageAsync(cmd.CommandText).ConfigureAwait(false); + msg = (IUserMessage)await channel.GetMessageAsync(msg.Id).ConfigureAwait(false); await NadekoBot.CommandHandler.TryRunCommand(guild, channel, msg).ConfigureAwait(false); //msg.DeleteAfter(5); }