mirror of
https://github.com/Myxelium/Lunaris2.0.git
synced 2026-04-13 16:10:36 +00:00
@@ -38,6 +38,26 @@ public static class MessageModule
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public static async Task RemoveMessages(this SocketSlashCommand context, DiscordSocketClient client)
|
||||
{
|
||||
var guildId = context.GetGuild(client).Id;
|
||||
|
||||
if (GuildMessageIds.TryGetValue(guildId, out var value))
|
||||
{
|
||||
if (value.Count <= 0)
|
||||
return;
|
||||
|
||||
foreach (var messageId in value)
|
||||
{
|
||||
var messageToDelete = await context.Channel.GetMessageAsync(messageId);
|
||||
if (messageToDelete != null)
|
||||
await messageToDelete.DeleteAsync();
|
||||
}
|
||||
|
||||
value.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task<ulong> StoreForRemoval(SocketSlashCommand context, DiscordSocketClient client)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user