bots

Proper way to build menus with python-telegram-bot

一笑奈何 提交于 2020-01-01 04:52:29
问题 I work with python-telegram-bot and try to build a system of nested menus as BotFather bot does. For instance, you have a general bot menu where you can choose "Edit Bot" and get the new corresponding menu with an option to get back to the previous menu. I try to achieve that with code: # main menu def start(bot, update): menu_main = [[InlineKeyboardButton('Option 1', callback_data='m1')], [InlineKeyboardButton('Option 2', callback_data='m2')], [InlineKeyboardButton('Option 3', callback_data=

How can I read from a website? [closed]

若如初见. 提交于 2019-12-31 07:49:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm trying to make a bot, how can I read the value like the 1800 / 1800 from a website? Console.WriteLine("Health: ") Console.WriteLine("Energy: ") Console.WriteLine("Cash: ") Console.WriteLine("Level: ") I'm making a console application, trying to get the value. Like if the health is lower then 1000/1800 then

Python - DM a User Discord Bot

六眼飞鱼酱① 提交于 2019-12-31 05:42:10
问题 I'm working on a User Discord Bot in Python .If the bot owner types !DM @user then the bot will DM the user that was mentioned by the owner. @client.event async def on_message(message): if message.content.startswith('!DM'): msg = 'This Message is send in DM' await client.send_message(message.author, msg) 回答1: The easiest way to do this is with the discord.ext.commands extension. Here we use a converter to get the target user, and a keyword-only argument as an optional message to send them:

Can i modify Azure Bot at VS? [closed]

旧城冷巷雨未停 提交于 2019-12-31 05:22:22
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I created a bot, using the Azure Bot Service and a dialog template. Then, I downloaded the code:here zip file Here's some of the code: [Serializable] public class BasicForm { [Prompt("Hi! What is your {&}?")] public string Name { get; set; } [Prompt("Please select your favorite car type {||}")] public CarOptions

How can I use a python discord bot cog to read all messages that are sent? on_message does not seem to be working

被刻印的时光 ゝ 提交于 2019-12-30 14:07:51
问题 I have the cog set up properly (which I know, because I have a separate cog which handles all of the commands, so that on_message does not mess them up), but on_message just doesn't do anything. I've tried including it into the other cog, but I still don't get an error with anything, it just doesn't work. I've also tried using different forms of @bot.event but these all just cause errors. Lastly, I know that the cog is working because the on_ready in the main .py alerts me that it had loaded

'stream.ReadTimeout' threw an exception of type 'System.InvalidOperationException' sending photo to telegram bot

青春壹個敷衍的年華 提交于 2019-12-30 06:21:41
问题 I wrote below code for sending a photo to my bot, but in my stream, I have two exceptions for read and write and my photo was not send. I think maybe the reason was this error, but I couldn't fix it: stream.ReadTimeout threw an exception of type 'System.InvalidOperationException' using (var stream = System.IO.File.Open("a.jpg", FileMode.Open)) { var fileToSend = new FileToSend("a.jpg", stream); Task.Run(() => bot.SendPhotoAsync(u.Message.Chat.Id, fileToSend).ConfigureAwait(false)); } 回答1: The

Creating a 'robot' to fill form with some pages in

只谈情不闲聊 提交于 2019-12-29 13:30:13
问题 I want to implement an 'robot' that could automatically fill forms. Is there an solution when you can fill data on page for example, form1.html and submit it, wait to next page and submit with data on form2.html ,and so on... In the end it should also 'click' on a button to get a file that the form creates. I want this 'robot' would use some confidential information, so it cant be done using client side technologies. I was thinking about PHP - building it as a web site-web service, so you

How to add custom choices displayed through Prompt options inside Cards & trigger actions on choice click in BOT V4 using c#?

こ雲淡風輕ζ 提交于 2019-12-29 08:08:51
问题 I am developing a chat bot using c# bot framework v4 sdk with multiple dialogs of waterfall type where one dialog class will display set of choices buttona through Prompt options. Now, I want to know whether these choices in prompt options or the prompt options all together be displayed in a card either hero or rich cards using c# in bot framework v4 I a waterfall dialog. Such that if I select a choice button inside the displayed card the respective option should be triggered in the next step

How to style chat window using CSS when using Microsoft Bot Framework

最后都变了- 提交于 2019-12-29 01:46:10
问题 I have created a simple Chat bot through the use of Microsoft Q&A maker and deployment to azure. Out of the box, the bot has its own default style. I want to be able to edit the look and feel of the chat window, possibly using CSS. I have found a couple of questions here but they do not give the complete answer I am looking for. I have done some research and found information at these URLs: https://github.com/Microsoft/BotFramework-WebChat https://github.com/Microsoft/BotBuilder/issues/202

Bot Framework fails to send FacebookQuickReply using AddKeyboardCard or using ChannelData

帅比萌擦擦* 提交于 2019-12-29 01:45:13
问题 I am using Bot Framework 3.3.0 which I understand supports Facebook's quick replies implemented properly (as opposed to creating a dynamic object and sending it via ChannelData ). The class name is Microsoft.Bot.Builder.ConnectorEx.FacebookQuickReply. Here is how I create the quick replies from within an IDialog: var reply = context.MakeMessage(); reply.Text = msg; var quickReplies = new List<FacebookQuickReply>() { new FacebookQuickReply(FacebookQuickReply.ContentTypes.Text, "Cathay",