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

Is there a way to run async function post_init, which looks like this


async def main(app):
while True:
task_1 = asyncio.create_task(asyncio.sleep(300))
await asyncio.gather(task_1)

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

>>> telegram.Bot()

yeah i think you are right - sometimes it does more harm by confusing stuff

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

>>> telegram.Bot()

wdym was there before

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

>>> telegram.Bot()

never thought about asking it lol

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

>>> telegram.Bot()

yes, just started coding 6 months ago and learning PTB since a few days so all the documentation is kinda overwhelming if you dont know what to look for exactly. ChatGPT is great help but it doesnt know V20 yet 🥶🥶🥲

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

>>> telegram.Bot()

but first how do i start? i am really2 newbie to this i’m sorry.

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

>>> telegram.Bot()

ok thx will try to play around with callback_query, right now i am only using message

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

>>> telegram.Bot()

im having trouble to find someone using his/her telegram id the numeric one not the username

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

>>> telegram.Bot()

i also used this documentation
maybe this example could be a bit more practical/noob-friendly
https://github.com/python-telegram-bot/python-telegram-bot/wiki/Storing-bot%2C-user-and-chat-related-data

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

>>> telegram.Bot()

Hello
Is it possible to ban a user for a period of time when they try to send lot of messages in a second?

I mean a built in function in PTB

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

>>> telegram.Bot()

i actually have a very similar question and probably i'am just too dumb. i am using update.message.from_user like in the conversationbot.py example. i understand that update and context provide dictionaries with user- or context-specific data. but how the heck do i simply access the user_id? :D

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

>>> telegram.Bot()

RuntimeWarning: coroutine 'Updater.start_polling' was never awaited
I’m new to asyncio, what does it realy mean?

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

>>> telegram.Bot()

how does the example solve this

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

>>> telegram.Bot()

depends very much on your setup, I can't make a general judgement

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

>>> telegram.Bot()

thanks for this, would check it out

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

>>> telegram.Bot()

but for example it worked great for learning how to implement sqlite3

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

>>> telegram.Bot()

i guess there has been message and callback_query in v12 already - so ChatGPT should know about it..

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

>>> telegram.Bot()

ChatGTP is just a kinda fitting line spewing machine, it wont ease you into coding. I would not suggest using it if you dont understand/can fix the outcome yourself

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

>>> telegram.Bot()

wait, i guess message and callback_query was there before ^^

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

>>> telegram.Bot()

between message and callback_query?

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

>>> telegram.Bot()

i still dont get the real difference ^^

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

>>> telegram.Bot()

just read back a few messages

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

>>> telegram.Bot()

If u want to get id when user presse a button then use callback_query instead of message

Btw thanks because of u i knew real meaning of update and context

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

>>> telegram.Bot()

thank you, already tried it but it wouldnt let me define a variable with it, maybe something else was wrong, but now i am at least sure that the syntax was right

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

>>> telegram.Bot()

Use update.message.from_user.id

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

>>> telegram.Bot()

Use update.callback_query.from_user instead of update.message.from_user

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

>>> telegram.Bot()

How to get username and ID of user that pressed an inline button

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

>>> telegram.Bot()

okay, thanks for the help

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

>>> telegram.Bot()

but i kind of feel i would implement a flask app that only listens for webhook to its url and instantiate another instance of the bot to process payments or do you think this is not the most ideal implementation

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

>>> telegram.Bot()

receiving webhook requests has little to do with a local API server. Please have a look at Webhooks, Running PTB alongside other asyncio frameworks and customwebhookbot.py

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