private Task OnLeftGuild(SocketGuild arg) { Matchmaking.OnLeftGuild(arg); ChannelHandler.OnLeftGuild(arg); BattleContext.OnLeftGuild(arg); return(Task.CompletedTask); }
private async Task OnChannelDeleted(SocketChannel arg) { // TODO: Prevent abuse of constant deletions of our stuff await ChannelHandler.OnChannelDeleted(arg); BattleContext.OnChannelDeleted(arg); }
private static async Task StartBattle(IGuild guild, SocketUser battler0, SocketUser battler1, string team0Name, string team1Name, string team0Mention, string team1Mention) { PBELegalPokemonCollection p0, p1; // Competitively Randomized Pokémon p0 = PBERandomTeamGenerator.CreateRandomTeam(3); p1 = PBERandomTeamGenerator.CreateRandomTeam(3); var battle = new PBEBattle(PBEBattleFormat.Single, PBESettings.DefaultSettings, new PBETrainerInfo(p0, team0Name), new PBETrainerInfo(p1, team1Name)); var bc = new BattleContext(battle, battler0, battler1); ITextChannel channel = await ChannelHandler.CreateChannel(guild, $"battle-{bc.BattleId}"); await channel.SendMessageAsync($"**Battle #{bc.BattleId} ― {team0Mention} vs {team1Mention}**"); await bc.Begin(channel); }
public async Task DontDelete() { await ChannelHandler.DontDelete(Context); }
private Task OnDisconnected(Exception arg) { Console.WriteLine(arg); ChannelHandler.OnDisconnected(); return(Task.CompletedTask); }
private Task OnConnected() { ChannelHandler.OnConnected(); return(Task.CompletedTask); }
private async Task CloseNormal(bool saveReplay) { CloseSilent(saveReplay); await ChannelHandler.ChangeCategory(_channel); }
private async Task CloseNormalAndDelete(bool saveReplay) { await CloseNormal(saveReplay); await ChannelHandler.MarkChannelForDeletion(_channel); }