telethonchat | Unsorted

Telegram-канал telethonchat - Telethon Chat

6097

Official Telethon's chat! Rules: • Speak English • Stay on topic (questions about Telethon) • Be respectful • Don't ask to ask • Spam-related uses lead to ban • Read https://docs.telethon.dev before asking things here Read more about us @TelethonUpdates

Subscribe to a channel

Telethon Chat

async def handler_allow_command(self, event):
"""
Allow access to user with @username for using bot
:param event:
:return:
"""
tid = event.sender_id
msg = event.text

username = msg.split(' ')[1]
user = self.db_wrapper.get_user_info_username(username.replace("@", "")
user['access'] = 1
self.db_wrapper.update_db(user)
event.respond("Allow",reply_to=user['id'])

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

Telethon Chat

are you sure it isn't the reply to msg id what's wrong?

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

Telethon Chat

Hello everyone. There is the following error:

Request caused struct.error: 'i' format requires -2147483648 <= number <= 2147483647: SendMessageRequest(peer=InputPeerUser(user_id=hidden, access_hash=hidden), message='Allow', no_webpage=False, silent=None, background=None, clear_draft=False, noforwards=None, update_stickersets_order=None, invert_media=None, reply_to=InputReplyToMessage(reply_to_msg_id=hidden, top_msg_id=None, reply_to_peer_id=None, quote_text=None, quote_entities=[], quote_offset=None), random_id=hidden, reply_markup=None, entities=[], schedule_date=None, send_as=None)
Unhandled exception on handler_allow_command

The error appears when I call the 'respond()' method on the Event(NewMessage) object.
If you open the bot API documentation, it is described that the id should be int64, but in telethon it is int32.
What should I do in this situation?
I checked that the id from the Event is really larger and is not overwritten by my code.

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

Telethon Chat

no, but if there's an update from telegram, you can use events.Raw

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

Telethon Chat

Place it on the top of handlers to stop other handlers receiving the update if same type

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

Telethon Chat

Dude as this request is asynchronous as you should call the function first
And then use it's attributes/output
Examples :

channel_title = await bot.get_entity(new_channel_id);channel_title = channel_title.title
#Example 1
channel_title = await bot.get_entity(new_channel_id),channel_title = channel_title.title
#Example 2 ( I don't know any important difference with the first)
channel_title = await bot.get_entity(new_channel_id)
channel_title = channel_title.title
#Example 3

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

Telethon Chat

you can print that to see what other attributes it has than title

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

Telethon Chat

i am wondering is tgconverter working or not and anyone who can use it

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

Telethon Chat

hello everyone, who can help me how to write a program where users register in the telethon through my telegram bot on aiogram3, I can't do anything

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

Telethon Chat

should be, and it's unknown for future, you should just confirm it's urlsafe base64 and not fully digits

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

Telethon Chat

Traceback (most recent call last):
  File "/storage/emulated/0/stars-check.py", line 6, in <module>
    from telethon.tl.types import MessageActionPrizeStars
ImportError: cannot import name 'MessageActionPrizeStars' from 'telethon.tl.types' (/data/data/com.termux/files/usr/lib/python3.11/site-packages/telethon/tl/types/init.py)


but i've updated to the newest version of telethon but still having this error?

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

Telethon Chat

Hi, how to update telethon layer 186

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

Telethon Chat

I'm running pyrogram bot but I wanted some telethon functions can I run that any idea

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

Telethon Chat

/channel/TelethonChat/621222

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

Telethon Chat

you write a code for it

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

Telethon Chat

excuse me, sorry if my english is bad
but i had same things like this problem https://github.com/LonamiWebs/Telethon/issues/4442

is there anythings that i can do to reduce it? thank you

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

Telethon Chat

telethon has supported int64 ids for years /channel/TelethonUpdates/1260

doublecheck what telethon version you have installed, and what is actually being called with incorrect values

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

Telethon Chat

Hey how can i check if message sent by user using account or channel

I tried if event.is_channel:

Every time is giving output as True whether its channel or not

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

Telethon Chat

Is there a poll answer handler in Telethon?

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

Telethon Chat

Simply place ignorance first

from telethon import events 

@bot.on(events.NewMessage(chats=[UserNameToIgnore, ]))
async def ignore_handler(_):
raise events.StopPropagation

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

Telethon Chat

No no thats other error

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

Telethon Chat

Which method!
Get_entity?

What exact code to check using the channel id

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

Telethon Chat

Hi and welcome to the group. Before asking any questions, please read the rules from the group's description, and don't forget to read the docs. Make sure you are using the latest version with pip3 install -U telethon, since most problems have already been fixed in newer versions.

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

Telethon Chat

Makes sense, thank you

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

Telethon Chat

/channel/TelethonChat/627595

/channel/TelethonChat/627492

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

Telethon Chat

This issue has already been fixed, but it's not yet available in PyPi. You can upgrade now with pip3 install -U https://github.com/LonamiWebs/Telethon/archive/v1.zip.

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

Telethon Chat

Hello, is it specified anywhere how many characters private groups/channels have after the "+" sign (/channel/+<characters>)? I've noticed it's always 16, but I'm not sure if there are cases where it's more/less than 16.

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

Telethon Chat

/channel/TelethonChat/609160

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

Telethon Chat

/channel/TelethonChat/564998

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

Telethon Chat

How can I make an inline button automatically? For example, I have the number of users. Every time a new user is added, an inline button will be created in his name

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