startup commands will no longer be treated as if theyr'e run in DMs
This commit is contained in:
parent
83dbc562af
commit
3a5aed213b
@ -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)).
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user