10206
This group is for questions, answers and discussions around the python-telegram-bot library. Off-topic group: @pythontelegrambottalk | Website: https://python-telegram-bot.org
Hey don’t think I’m dumb 😭 but even after all this time I still can’t figure out which library this group is mainly about 👀 is it PTB maybe? Someone explain pls
Читать полностью…
def button(update: Update, context: CallbackContext) -> None:Читать полностью…
query = update.callback_query
query.answer()
if query.data == 'copy_text':
text_to_copy = "This is the text you can copy!"
query.edit_message_text(text=f"Copied: {text_to_copy}")
Oh u want a button to copy the text instead of click to copy?
Читать полностью…
Like imagine this scenario 👀 there’s an inline button saying “Your ID” and when you tap it, the ID gets copied directly 😭 kinda like those ID/info bots… how do people make that logic?
Читать полностью…
Will it work in webassembly? Has anyone tried?
Читать полностью…
can you please show where is it? I only found "disallow create"
Читать полностью…
Hi! Question is related to new telegram feature: Bot Threads
Bot can create and delete threads, and user too.
If bot deletes thread, messages under that thread are also gone.
But if user deletes thread, it's kinda "soft" deleted, because messages are still there. And bot can even rename thread - system message will appear, but no thread visible.
Is it possible to restore thread deleted by user? I want my bot fully control threads, and I don't want user manage threads
Then just set protect_content, either in every method you want this or by default
Читать полностью…
I moved this discussion to the off-topic group.
Читать полностью…
telegram.InlineKeyboardButton(..., copy_text=...)
python-telegram-bot documentation for this parameter of telegram.InlineKeyboardButton:
copy_text
But I can't see Inline button workflow..
Can I run into Pydroid 3 for test ?
Can someone explain this 👀 I can already add buttons in my bot but how do I add logic so tapping the button copies text directly 😭 anyone knows?
Читать полностью…
There are real programmers here — not vibe coders
Читать полностью…
# акмаль, it’s not possible to completely prevent users from deleting their own threads “softly” if they have basic permissions. However, you can limit topic management:
Go to Group Settings → Administrators.
For each admin (except the bot), disable the “Manage Topics” permission.
Also check the group permissions for regular members and make sure this is disabled there as well.
After that, only your bot (with admin rights) will be able to create and delete topics. If a user deletes something locally, that’s a feature of the Telegram client, and the bot cannot influence it through the API. Unfortunately, it’s also not possible to restore a thread deleted by a user via the Bot API.
i Guess the fastest thing you can do is deactivating manage threads permission for all the admins and enable it for only for your bot
Читать полностью…
ext.Defaults.protect_content
python-telegram-bot documentation for this property:
telegram.ext.Defaults.protect_content
Do you mean forward from a bot chat or forward into the bot chat? First one yes, second you have to program yourself with a filter, no way to stop users with a botfather setting or so
Читать полностью…
Who is an expert in PHP here? I’ve developed a complex bot that generates and securely stores strong passwords for social media, but it's being rejected by my hosting server (myxvest.ru). Any advice on how to fix this or what might be causing the issue?
Читать полностью…