Exemplo n.º 1
0
 private ValueTask UnlockLewdAchievementAsync(IContext e, AchievementService service)
 {
     if (MikiRandom.Next(100) == 50)
     {
         var lewdAchievement = service.GetAchievementOrDefault(AchievementIds.LewdId);
         return(new ValueTask(service.UnlockAsync(e, lewdAchievement, e.GetAuthor().Id)));
     }
     return(default);
Exemplo n.º 2
0
        private async Task OnMessageCreateAsync(IDiscordMessage arg)
        {
            if (!(app is MikiBotApp botApp))
            {
                return;
            }

            switch (arg.Content.ToLowerInvariant())
            {
            case "here come dat boi":
            {
                var a = achievementService.GetAchievement(AchievementIds.FrogId);
                await botApp.CreateFromMessageAsync(
                    arg,
                    async ctx => await achievementService.UnlockAsync(a, arg.Author.Id));
            }
            break;

            case "( ͡° ͜ʖ ͡°)":
            {
                var a = achievementService.GetAchievement(AchievementIds.LennyId);
                await botApp.CreateFromMessageAsync(
                    arg,
                    async ctx => await achievementService.UnlockAsync(a, arg.Author.Id));
            }
            break;

            case "poi":
            {
                var a = achievementService.GetAchievement(AchievementIds.ShipId);
                await botApp.CreateFromMessageAsync(
                    arg,
                    async ctx => await achievementService.UnlockAsync(a, arg.Author.Id));
            }
            break;
            }

            if (MikiRandom.Next(0, 10000000000) == 5234210)
            {
                var a = achievementService.GetAchievement(AchievementIds.LuckId);
                await botApp.CreateFromMessageAsync(
                    arg,
                    async ctx => await achievementService.UnlockAsync(a, arg.Author.Id));
            }
        }