Пример #1
0
 private Task AnimeReactCommand(
     string noUserReply,
     string botUserReplyMsg,
     string botUserReplyImg,
     string sameUserReplyMsg,
     string sameUserReplyImg,
     string failureReply,
     string successReply,
     string endpointPlainName,
     IGuildUser user,
     SocketCommandContext context)
 {
     if (user == null)
     {
         return(ReplyAsync(noUserReply));
     }
     else if (user.Id == context.Client.CurrentUser.Id)
     {
         return(Task.Run(async() =>
         {
             if (botUserReplyMsg != null)
             {
                 await ReplyAsync(botUserReplyMsg);
             }
             if (botUserReplyImg != null)
             {
                 await ReplyAsync(botUserReplyImg);
             }
         }));
     }
     else if (user.Id == context.User.Id)
     {
         return(Task.Run(async() =>
         {
             if (sameUserReplyMsg != null)
             {
                 await ReplyAsync(sameUserReplyMsg);
             }
             if (sameUserReplyImg != null)
             {
                 await ReplyAsync(sameUserReplyImg);
             }
         }));
     }
     return(Task.Run(async() =>
     {
         (bool success, string url) = await NekosLifeInterface.TryGetEndpoint(endpointPlainName);
         if (!success)
         {
             await ReplyAsync(failureReply);
             return;
         }
         await Context.Channel.SendMessageAsync("", false, Helpers.ImgStrEmbed(url, successReply));
     }));
 }
Пример #2
0
        public async Task Cat()
        {
            (bool success, string url) = await NekosLifeInterface.TryGetEndpoint("cat");

            if (!success)
            {
                await ReplyAsync("I-I couldn't find any cats... I'm sorry ;-;");

                return;
            }
            await ReplyAsync(url);
        }