i'm trying to do buttons,inline buttons,
json.dumps({"keyboard":[[{'text':'yayaya','request_contact':True},{'text':'google','url':'https://tts.ua'}]],})
First button wokrs, but other send only text, please help me
You want to use keyboard, which only supported requests.
But url is parameter of inline_keyboard, you can't use both at the same time.
Related
I need to send requests from my website to Midjourney on Discord. The user will attach a photo and text with information about the image he wants to get. Then this information needs to be sent to midjourney in discord. After midjourney generates the image, it must be sent back to the website. How can I do this? I couldn't find a way to send the command /imagine to midjourney with python. Is this even possible?
Yes, it is, and by the way, this is a duplicate of my question I think...
anyway try this https://github.com/Wildric-Auric/MidJourney-Wrapper
It's a wrapper, it is a bot that can call the /imagine command, I'm currently having problems with it on my other questions in StackOverflow.
you can add functionality to it and make it send its commands automatically
I need a telegram bot that sends you inline button with some information bellow and when you press that button, it sends information (not an URL or something) I need a message with an image for example, when I search for tutorials it only shows me to put URLs, if someone can help me I would be so gratefull
A quick search reveals that you are searching for a keyboard and if you look into the python-telegram-bot library, you can find examples like inlinekeyboard2.py. Once you understand how it works, you can move on to sending a message. I suggest you take a look at the resources section in the same library, since you tagged python.
If you try this and fail at a clear definable problem, then you might ask a question here (in a new thread), so that you can get an exact solution.
do someone know if there is a way to open a URL when someone write /start or some command.
I already tried with requests, but it hasnt worked.
Thanks!
You can redirect users to other groups/chats by providing them with an invite link or the username of the group/channel in the #username format. If you want that to happen on the press of a button, you can use InlineKeyboardButton by passing the invite link directly to the button, i.e. InlineKeyboardButton(text='some_text', url='http://t.me/…'). The URL will open (i.e. redirect the user to the target chat), when the button is clicked.
I am relatively new to python and I am trying to create a telegram bot using telebot, which will create a quiz-like game, and each user can create their own quiz-like game also. During the step by step process of creating this quiz by the user, at one point, I need them to send me a poll, just like how they create a new poll in a group. But there is no create poll button inside telegram bot as these buttons are generally found in groups and not in one-one chats.
So I need to create an inline keyboard button, which upon clicking will let the users create a poll and send it to the bot. I have gone through the documentation in github and couldn't find anything useful for this.
This similar thing is implemented by telegram's own "Quizbot". I'll attach the screenshots from that bot for clarity. Please help me identify how to implement it in my bot.
If 'Create question" button is clicked:
I am a noob to python and coding, so please help me with this problem.
edit: I can send a poll to the bot if I am using telegram desktop and not from the phone. I want to know how to enable to use it in the phone.
By using telebot we can do this. This gives us the opportunity to create poll from phone apps also.
import telebot
from telebot.types import ReplyKeyboardMarkup,KeyboardButton,
KeyboardButtonPollType,ReplyKeyboardRemove
bot=telebot.Telebot(token='your bot token')
poll_markup=ReplyKeyboardMarkup(one_time_keyboard=True)
poll_markup.add(KeyboardButton('send me a poll',
request_poll=KeyboardButtonPollType(type='quiz')))
#from my experience, only quiz type and regular type polls can be send.
remove_board=ReplyKeyboardRemove()
bot.send_message(chat_id,text,reply_markup=poll_markup)
#some other code here
#this can be used to remove the replykeyboard when you no longer need it.
bot.send_message(chat_id,text,reply_markup=remove_board)
I'v searched almost two days but had not found anything relevant...
Basically every article and post talks about how to use a bot sending message as itself, but how I could send messages as the user?
I will create a GUI using tkinter with a entry and a button, where the button command function will send the entry as a message of the user.
I know that I can automate it using selenium, but there's any best solution?