public async Task Reset(ulong guildId) { var guild = await Context.Client.GetGuildAsync(guildId); if (guild != null) { var collection = _mongo.GetCollection <Penalty>(Context.Client); await collection.DeleteManyAsync(f => f.GuildId == guildId); await PenaltyModule.Restore(_mongo, Context.Client as DiscordShardedClient, guild as SocketGuild); await ReplyAsync($"Guild {guild} has been reset to default penalties"); } }
public async Task Reset() { var database = _mongo.GetDatabase(Context.Client.CurrentUser.Username.Replace(" ", "")); database.DropCollection("Penalty"); var counter = 0; foreach (var guild in await Context.Client.GetGuildsAsync()) { counter++; await PenaltyModule.Restore(_mongo, Context.Client as DiscordShardedClient, guild as SocketGuild); } await ReplyAsync($"{counter} guilds have been reset."); }
public async Task Reset(ulong guildId) { var guild = await Context.Client.GetGuildAsync(guildId); if (guild != null) { await _unit.Penalties.GetAllAsync(Context.Guild); await PenaltyModule.Restore(_unit, guild); await ReplyAsync($"Guild {guild} has been reset to default penalties"); } else { await ReplyAsync($"Guild with the ID `{guildId}` not found!"); } }