pythontelegrambotgroup | Unsorted

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

10221

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()

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?

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

>>> telegram.Bot()

Hi everyone....i would like to take a message of the bot and extract an ip address from It..... I used the echobot.py but these is only for user....do you have any ideas?

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

>>> telegram.Bot()

and what do you expect that to be instead, this "working it out"

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

>>> telegram.Bot()

mod.__user_info__(chat_obj.id) is a coroutine what is your question

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

>>> telegram.Bot()

Use hosting, I use pythonanywhere personally

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

>>> telegram.Bot()

I moved this discussion to the off-topic group.

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

>>> 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()

You mean the message includes an IP address and you want to extract that from it, or...?

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

>>> telegram.Bot()

Hey guys anyone know who the "reacted" people in a channel comment are? (Even though they did not react with an emoji)

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

>>> telegram.Bot()

It's keep showing me this error
Tried various ways
It didn't worked out

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

>>> telegram.Bot()

for mod in USER_INFO:
try:
mod_info = mod.__user_info__(chat_obj.id).strip()
except TypeError:
mod_info = mod.__user_info__(chat_obj.id, chat.id).strip()

head += "\n\n" + mod_info if mod_info else ""

'coroutine' object has no attribute 'strip'

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

>>> telegram.Bot()

bot/user/chat_data is in-memory only by default. you could use ptbs persistency setup to achieve something like this, but you'd have to be careful not to override data from two different processes. So let me first ask you: What exactly is the goal here? This seems like an xy-problem to me.

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

>>> telegram.Bot()

PTB doesn't cover webdev, the example is just an extremely basic demonstration on how to send a webapp and take input from it
Anything beyond that is completely out of the library's scope

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