コード例 #1
0
 public Task <bool> HandleAsync(IIncomingMessage message, IVityaBot bot)
 {
     return(bot.SendMessageAsync(new OutgoingMessage()
     {
         peer_id = message.peer_id, message = string.Format("Твоя картинка говно")
     }));
 }
コード例 #2
0
 public Task <bool> HandleAsync(IIncomingMessage message, IVityaBot bot)
 {
     return(bot.SendMessageAsync(new OutgoingMessage()
     {
         peer_id = message.peer_id, message = string.Format("Все говорят {0}, а ты пошел на хуй", message.text)
     }));
 }
コード例 #3
0
ファイル: CommandStatus.cs プロジェクト: SNAKEspb/VKBot
 public override async Task handleAsync(IIncomingMessage message, IVityaBot bot, Match match)
 {
     var outgoingMessage = new Models.OutgoingMessage()
     {
         peer_id = message.peer_id,
         message = $"bot test mode is {bot.mode.ToString()}"
     };
     await bot.SendMessageAsync(outgoingMessage);
 }
コード例 #4
0
 public override async Task handleAsync(IIncomingMessage message, IVityaBot bot, Match match)
 {
     var outgoingMessage = new Models.OutgoingMessage()
     {
         peer_id = message.peer_id,
         message = $"Бэтмен {Generator.generate(SwearWordGenerator.Type.Adjective, 2, Sex.M, Case.I)} {Generator.generate(SwearWordGenerator.Type.Noun, 2, Sex.M, Case.I)}"
     };
     await bot.SendMessageAsync(outgoingMessage);
 }
コード例 #5
0
ファイル: CommandMode.cs プロジェクト: SNAKEspb/VKBot
 public override async Task handleAsync(IIncomingMessage message, IVityaBot bot, Match match)
 {
     bot.mode = Enum.Parse <VKBot.VkBot.Mode>(match.Groups[1].Value);
     var outgoingMessage = new Models.OutgoingMessage()
     {
         peer_id = message.peer_id,
         message = $"bot test mode is {bot.mode.ToString()}"
     };
     await bot.SendMessageAsync(outgoingMessage);
 }
コード例 #6
0
ファイル: CommandMemeList.cs プロジェクト: SNAKEspb/VKBot
 public override async Task handleAsync(IIncomingMessage message, IVityaBot bot, Match match)
 {
     var peers           = VkontakteBot.Services.DataService.activeMemes.Select(t => t.Id + " - " + t.title + " - " + t.description);
     var outgoingMessage = new Models.OutgoingMessage()
     {
         peer_id = message.peer_id,
         message = string.Join("\n", peers)
     };
     await bot.SendMessageAsync(outgoingMessage);
 }
コード例 #7
0
 public override async Task handleAsync(IIncomingMessage message, IVityaBot bot, Match match)
 {
     var outgoingMessage = new Models.OutgoingMessage()
     {
         peer_id = message.peer_id,
         //message = text,
         attachment = Services.DataService.pictures["joke"],
         //group_id = message.
     };
     await bot.SendMessageAsync(outgoingMessage);
 }
コード例 #8
0
        public async Task <bool> HandleAsync(IIncomingMessage message, IVityaBot bot)
        {
            foreach (var attach in message.attachments.Where(x => x.type == "audio"))
            {
                await bot.SendMessageAsync(new OutgoingMessage()
                {
                    peer_id = message.peer_id, message = string.Format("{0} говно", attach.audio.artist)
                });
            }

            return(true);
        }
コード例 #9
0
        public async Task <bool> HandleAsync(IIncomingMessage message, IVityaBot bot)
        {
            foreach (var attach in message.attachments.Where(x => x.type == "wall"))
            {
                await bot.SendMessageAsync(new OutgoingMessage()
                {
                    peer_id = message.peer_id, message = string.Format("Опять всякое говно репостим")
                });
            }

            return(true);
        }
コード例 #10
0
        public override async Task handleAsync(IIncomingMessage message, IVityaBot bot, Match match)
        {
            var memes = VkontakteBot.Services.DataService.activeMemes;

            foreach (var meme in memes)
            {
                await bot.processMemeByIdAsync(message.peer_id, meme.Id, meme.title + ";" + meme.description);
            }
            var outgoingMessage = new Models.OutgoingMessage()
            {
                peer_id = message.peer_id,
                message = $"test memes finished"
            };
            await bot.SendMessageAsync(outgoingMessage);
        }
コード例 #11
0
        public override async Task handleAsync(IIncomingMessage message, IVityaBot bot, Match match)
        {
            var peerId = match.Groups[1].Value;
            var text   = match.Groups[2].Value;

            if (!string.IsNullOrEmpty(text))
            {
                var outgoingMessage = new Models.OutgoingMessage()
                {
                    peer_id = peerId,
                    message = text
                };
                await bot.SendMessageAsync(outgoingMessage);
            }
        }
コード例 #12
0
ファイル: WallMessageHandler.cs プロジェクト: SNAKEspb/VKBot
        public async Task <HandlerResult> HandleAsync(IIncomingMessage message, IVityaBot bot)
        {
            var outgoingMessage = new OutgoingMessage()
            {
                peer_id = message.peer_id,
                //message = text,
                attachment = Services.DataService.pictures["communityLike"],
                //group_id = message.
            };
            await bot.SendMessageAsync(outgoingMessage);

            return(new HandlerResult()
            {
                message = "ok"
            });
        }
コード例 #13
0
        public override async Task handleAsync(IIncomingMessage message, IVityaBot bot, Match match)
        {
            var memeId = match.Groups[1].Value;
            var memes  = VkontakteBot.Services.DataService.activeMemes;
            var meme   = memes.FirstOrDefault(t => t.Id == memeId);

            if (meme != null)
            {
                await bot.processMemeByIdAsync(message.peer_id, meme.Id, meme.title + ";" + meme.description);
            }
            var outgoingMessage = new Models.OutgoingMessage()
            {
                peer_id = message.peer_id,
                message = $"test {memeId} finished"
            };
            await bot.SendMessageAsync(outgoingMessage);
        }