pythontelegrambotgroup | Unsorted

Telegram-канал pythontelegrambotgroup - >>> telegram.Bot()

7508

This group is for questions, answers and discussions around the python-telegram-bot library. Off-topic group: @pythontelegrambottalk | Website: https://python-telegram-bot.org

Subscribe to a channel

>>> telegram.Bot()

in the FAQ page there is a simple code but is not working.... bot.send_message() i can't find it

Читать полностью…

>>> telegram.Bot()

As i saw yesterday....i need to read, in a chat, only the messages sent by the bot...not the messages user because i need to extract an information

Читать полностью…

>>> telegram.Bot()

Hello! Is it possible to change the size/text size of the inline buttons?

Читать полностью…

>>> telegram.Bot()

I saw this FAQ but the code is not good for 20.8v
it is not working......

Читать полностью…

>>> telegram.Bot()

what is the best way to prevent the user from spamming a callback query handler ?

Читать полностью…

>>> telegram.Bot()

do you know why it is not possible. 😅

Читать полностью…

>>> telegram.Bot()

I guessed it, I will do a workaround then. thank you N and "This is fine(2)" for your support again.

Читать полностью…

>>> telegram.Bot()

the edit of the message will be handle in the CallBackQueryHandler...

Читать полностью…

>>> telegram.Bot()

Hi, I'm unable to edit a message send by the bot, if it contains a replay_markup.
anyone know why?

Читать полностью…

>>> telegram.Bot()

Maybe, i saw too this class but (maybe I'm just misunderstanding too) i don't think this could help me. I'll try to explain the whole process
I have a command that calls an api that retrieve all my devices/services in my environment. I show them using a inline keyboard. When user click one of them, like the motor service, telegram a new api that retrieves all functions available for my motor. I show them using a new inline keyboard.
Functions may have different structures:
1)some of them can retrieve data (eg i want to know le position of my motor)
2)some are commands (eg i want my motor to return to its zero)
3)some are commands, so user needs to specify something (eg user says to motor to rotate 45 degrees).
So click on buttons in inline keyboard may be a good idea in case 1 or 2 but in case 3 i need something more. An idea is to prepare the message editable so user has to add only the custom part
Eg
u: /services
bot: telegram, motor, noir camera
u: *click on motor*
bot: *retrieve motor functions* getDegree, rotate, goToZero
Case 1 ->
u: *click on getDegree*
b: *retrieve degrees*
Case 2 ->
u: *click on rotate *
b: *prepare the following message in draft* /rotate ? motor1
u: *complete the message then send * /rotate ?motor1 90
b: *rotate motor*

Читать полностью…

>>> telegram.Bot()

And json is a format not a python type. You can have json strings, dicts, lists, etc.

Читать полностью…

>>> telegram.Bot()

You can always look at the docs or do a type() call

Читать полностью…

>>> telegram.Bot()

You can only react with emojis

Читать полностью…

>>> telegram.Bot()

Yes...sure i'm using a regex but i have to access to the bot message not user message....probably the @BiboJoshi solution can be the right way....

Читать полностью…

>>> telegram.Bot()

Hi Harry...
Thank you for your quick reply....i send from graylog a message with an ip address inside.... The message is sent from the bot itself...

Читать полностью…

>>> telegram.Bot()

I thought that the echo examples could be good for this but it read only user messages

Читать полностью…

>>> telegram.Bot()

there always is a chance, currently it's just very low 🤡
The biggest problem is that we were not yet able to come up with a clean implementation idea.

Читать полностью…

>>> telegram.Bot()

Is there any chance of a proper implementation coming in the library?

https://github.com/python-telegram-bot/python-telegram-bot/issues/2539#issuecomment-1773883020

Читать полностью…

>>> telegram.Bot()

Wiki of python-telegram-bot - Category Design Pattern
How to deal with multiple CBQ from one button

Читать полностью…

>>> telegram.Bot()

The answer is still "Because Telegram said so"

Читать полностью…

>>> telegram.Bot()

To be more specific — you can only edit messages with no reply markup at all, or with inline keyboard markup

Читать полностью…

>>> telegram.Bot()

Because Telegram said so

Читать полностью…

>>> telegram.Bot()

reply_keyboard = [[KeyboardButton("send phone no", request_contact=True)]]
markup = ReplyKeyboardMarkup(
reply_keyboard,
one_time_keyboard=True,
)

msg = await update.message.reply_text(
"Start: Send your phone number", reply_markup=markup
)


^ this cant be edited

but if I remove reply_markup=markup It can be edited later using msg.edit_text

Читать полностью…

>>> telegram.Bot()

You can't really prepare a message in draft, you could via inline queries but that is a very weird user experience.

Just edit the message, write in it "Please send the degrees you want the motor to rotate, as a number between 0-360" and messagehandler the next update

Читать полностью…

>>> telegram.Bot()

Whatever mod.__user_info__(chat_obj.id) is. it's a coroutine. If you want to do something to the result of calling said coroutine, you have to await it first

Читать полностью…

>>> telegram.Bot()

None, Message Object

Читать полностью…

>>> telegram.Bot()

You mean what type? Message

Читать полностью…

>>> telegram.Bot()

Sounds good....do you know which format is the message variable?

Читать полностью…

>>> telegram.Bot()

If you inject the IP address into the message surely you already have it? Or just do a regex to find the IP if its part of a larger string

Читать полностью…

>>> telegram.Bot()

Wiki of python-telegram-bot - Category FAQ
How do I access info about the message my bot sent?

Читать полностью…
Subscribe to a channel