Ejemplo n.º 1
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());
            }
        }
Ejemplo n.º 2
0
 public bool Audit(ICommandContext context, ResponseService responser)
 => base.Audit(context.User.Id, () =>
 {
     var time = new TimeSpan(0, 0, (int)cooldown / 1000).AsRoundedDuration();
     _        = responser.SendToContextAsync(context, $"{context.User.Mention}, you are sending commands too fast, you will be ignored for the next {time}.");
 });