Example #1
0
 private Task OnLeftGuild(SocketGuild arg)
 {
     Matchmaking.OnLeftGuild(arg);
     ChannelHandler.OnLeftGuild(arg);
     BattleContext.OnLeftGuild(arg);
     return(Task.CompletedTask);
 }
Example #2
0
        private async Task OnChannelDeleted(SocketChannel arg)
        {
            // TODO: Prevent abuse of constant deletions of our stuff
            await ChannelHandler.OnChannelDeleted(arg);

            BattleContext.OnChannelDeleted(arg);
        }
Example #3
0
        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);
        }
Example #4
0
 public async Task DontDelete()
 {
     await ChannelHandler.DontDelete(Context);
 }
Example #5
0
 private Task OnDisconnected(Exception arg)
 {
     Console.WriteLine(arg);
     ChannelHandler.OnDisconnected();
     return(Task.CompletedTask);
 }
Example #6
0
 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);
        }