예제 #1
0
 private void ExpireSession(TowerBanSession session)
 {
     foreach (var user in session.Users)
     {
         if (!user.Choice.HasValue)
         {
             _ = responseService.SendToChannelAsync(session.InitiateChannel, $"{user.User.Mention} has failed to respond in time for a tower banning session.");
         }
     }
     sessions.Remove(session);
 }
예제 #2
0
        public async Task ReplyAsync(SocketCommandContext context, string message)
        {
            if (message.Length < 2)
            {
                return;
            }

            var typing = responseService.StartTypingAsync(context);

            var delay = Task.Delay(500);
            var reply = await ChatSystem.ReplyAsync(message);

            //reply = UwuTranslator.Translate(reply);
            reply = reply.SliceBack(1900);

            await delay;

            await responseService.SendToContextAsync(context, reply, typing);

            if (context.IsPrivate && context.User.Id != ApplicationContext.BotOwner.Id)
            {
                await responseService.SendToChannelAsync(discordLogger.LogChannel, "DM chat received:", new EmbedBuilder()
                                                         .WithAuthor(context.User)
                                                         .WithDescription(message)
                                                         .AddField("Response", reply)
                                                         .Build());
            }
        }