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'])
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
Place it on the top of handlers to stop other handlers receiving the update if same type
Читать полностью…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
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
Читать полностью…should be, and it's unknown for future, you should just confirm it's urlsafe base64 and not fully digits
Читать полностью…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?
I'm running pyrogram bot but I wanted some telethon functions can I run that any idea
Читать полностью…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 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
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
Simply place ignorance first
from telethon import eventsЧитать полностью…
@bot.on(events.NewMessage(chats=[UserNameToIgnore, ]))
async def ignore_handler(_):
raise events.StopPropagation
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.
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
.
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.
Читать полностью…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
Читать полностью…