New StackOverflow question
Problem at providing entities to NewMessage event
https://stackoverflow.com/q/79146370
guys, can i get api_hash and api_id of the account using program or i have to do it manualy
Читать полностью…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.
The bot is already responding to the message from the channel to the group; it just isn't sending to specific topics. That's all I want.
Читать полностью…else block for adding via username.
both attributes result.missing_invities
and result.updates.users
are empty but I suppose it should not be so.
May be it is bad apporoach to use ImportContactsRequest ?
the code is honestly useless, plus I'm a bit sleepy to make sense of "bot will monitor whether the last message in the topics is from the bot or not", make sure you know what a bot is allowed to do in the API
if your flow explicitly depends on forum topics and other recent enough features like quote replies, and you are referring to a real bot with "bot" and not userbot, just use another BotApi library that has proper topic support than telethon
if you pick telethon, you should know what you're doing, and I linked you a clear way of what how to deal with topics
whatever you're going through, we'll discuss it once you show a code you understand what is wrong with
and showing video or screenshot will also reduce the time it takes to convey your goals and of an answer
contacts = [
InputPhoneContact(
client_id=random.randrange(-2**63, 2**63),
phone=phone,
first_name=f'first_{hash(phone)}',
last_name=f'last_{hash(phone)}'
)]
result = await client(ImportContactsRequest(contacts=contacts))
if result.users:
user = result.users[0]
else:
raise PrivacyRestrictedError
res = await client(InviteToChannelRequest(chat, [user]))
else:
res = await client(InviteToChannelRequest(chat, [username]))
if res.missing_invitees:
raise PrivacyRestrictedError
result.users
is also empty and user was not added in fact.Can someone help me with a code here? It's for a bot on Telegram:
What I'm trying to do is, reply to a specific message from a channel and send it to topics in a group, the bot will monitor whether the last message in the topics is from the bot or not, if not it will reply again
Can someone help me?
https://hastebin.com/share/vahajojahe.python
group topic id is 1, 2, 5
New api update let's update a message adding a media, can we already do that with current telethon or it needs to be updated?
Читать полностью…it's a question in case you don't no
if you mean profile photo limits, it's not very specified, telethon already keeps them in file size limit, so ratio should be resized by Telegram
Hello! Can anyone help me? I'm trying to make a userbot with Telethon that reacts to a command like /start, responds with text, and includes inline buttons. Can I do this with Telethon? Thank you for your answer!
Читать полностью…This bot isn't useless to me, but thank you for your attention. I'll try elsewhere. I really appreciate it, brother. ❤️🙏🏽
Читать полностью…I won't lie, man. This code was made for me by a friend, but he's been busy lately and can't help me right now. So I was trying to do it on my own with the help of AI, but I don't have any programming knowledge. That's why I'm here asking for your help.
Читать полностью…The code is 90% ready; I just want it to respond to a message from a channel to a group that has 3 topics. So when someone sends a message in one of these 3 topics, the bot will reply again. That's all I want. Can I add you to the group where I'm testing the bot so you can better understand what I'm trying to say?
Читать полностью…your totally legit 100% no cap usecase may be getting unfairly oppressed by the math heads on server, if you believe so, contact them or something
besides, when result.users is empty it should be raising as you coded the else block if not see the other attributes of "result", otherwise it's something to do with that chat in particular
Dude, can you help me do what I said? I've been trying to do this for a while now and I can't, and I've joined more than 20 groups, I ask for help and no one answers.
Читать полностью…there are no friendly properties for topics, and there won't be, see /channel/TelethonChat/611203 (message == event) to know how to know topic of an event and send something to a topic_id.
anything else will you need explain whatever you're doing properly, with less AI in code
That is not related to Telethon. Please move to a different group with the correct topic to continue that conversation
Читать полностью…if proxy when unused sends the code, you know who to ask, either blame the proxy or blame yourself for using a proxy and later blame Telegram for making you blame the proxy and yourself
Читать полностью…