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

it's in raw api as SetBotCommands, no built-ins

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

Telethon Chat

Any friendly way to set bot commands like the format accepted by botfather ?

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

Telethon Chat

and for some reason I can’t get the id

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

Telethon Chat

Those are grouped by your Telegram app. they're all seperate messages

each message will have equal message.grouped_id

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

Telethon Chat

Hi guyz, how can I find out the ID of a photo from a received message?

ok I think I found it, photo.id, yes?)

How can I find out the ID of only one photo if there is a random number of them in a message?

what is the difference between dс_id and id

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

Telethon Chat

how do we import telethon v2 via poetry?

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

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

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

Can I find freelancer here?

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

Telethon Chat

Hello everybody 👋🏻
please tell me how to log into telegram using the telethon.session file
does anyone have instructions?

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

Telethon Chat

Oh ty i gonna try it

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

Telethon Chat

The cause of this error is most likely using the same session in multiple scripts (or having another older process using the same session file). To fix it you need to use one session file per script (or per client)

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

Telethon Chat

/channel/TelethonChat/574895

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

Telethon Chat

It's still a server issue if it happens in "rust" one too. datacenter of chat versus account can delay implicit updates. pyro event system is more lacking than telethon's, it almost does nothing. other than Get*Difference when min entity is detected.. so it should be a coincidence you can rule out by running that on the chat with telethon at the start of script. if updates are still delayed, it's Telegram thing

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

Telethon Chat

Ask the server, you can logout from both and test with new sessions under same conditions simultaneously

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

Telethon Chat

Is the iter_dialogs sorted?

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

Telethon Chat

async def normal_handler(event):
if event.photo:
print('photo_id', event.photo.id, 'dc_id', event.photo.dc_id, 'gallery_id', event.grouped_id)

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

Telethon Chat

did not know

and how i can take for only one from the group?

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

Telethon Chat

wdym? a message can only have one photo/media at a time

dc_id is unimportant, it's server location where media is stored

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

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

From the new telegram account, how many people can I send a message to?

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

Telethon Chat

New StackOverflow question
Telegram login blocked despite correct code - Python Telethon

https://stackoverflow.com/q/77353014

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

Telethon Chat

yes you can ask for people to help you on a paid job

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

Telethon Chat

Read The Docs!

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

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

You already have a different TelegramClient instance using that session file as mentioned above, switch to StringSession or avoid that from happening. and Quart may be more appropriate for an async library like telethon

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

Telethon Chat

My code:

from flask import Flask
from flask_socketio import SocketIO, emit
from flask_cors import CORS
from configparser import ConfigParser
from telethon import TelegramClient, events, sync
import pandas as pd
import asyncio
from queue import Queue

app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "*"}})
socketio = SocketIO(app, cors_allowed_origins="*")

codes_queue = Queue()

def validate_config(config):
required_params = ['api_id', 'api_hash', 'phone_number']
for param in required_params:
if not config['Telegram'].get(param) or config['Telegram'].get(param) == param:
return False
return True

def get_config():
config = ConfigParser()
config.read('config.ini')
return config

def check_is_auth(phone_number, api_id, api_hash):
client = TelegramClient(phone_number, api_id, api_hash)
client.connect()

if not client.is_user_authorized():
socketio.emit("message", {"code_need": True, "data": "Code need"})

@socketio.on('get_config')
def handle_get_config_data():
config = get_config()

if not validate_config(config):

emit('error', {"valid_config": False, 'error': 'Please provide valid values for api_id, api_hash, and phone_number in the config.ini file'}), 400
return

emit('message', {'data': 'Sucsess'})
check_is_auth(config['Telegram']['phone_number'], config['Telegram']['api_id'], config['Telegram']['api_hash'])

if __name__ == '__main__':
loop = asyncio.new_event_loop(socketio.run(app, port=5000, debug=True))
asyncio.set_event_loop(loop)


Error:
Exception in thread Thread-17 (_handle_event_internal):
Traceback (most recent call last):
File "/usr/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
self.run()
File "/usr/lib/python3.11/threading.py", line 982, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/socketio/server.py", line 731, in _handle_event_internal
r = server._trigger_event(data[0], namespace, sid, *data[1:])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/socketio/server.py", line 756, in _trigger_event
return self.handlers[namespace][event](*args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/flask_socketio/__init__.py", line 282, in _handler
return self._handle_event(handler, message, namespace, sid,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/flask_socketio/__init__.py", line 828, in _handle_event
ret = handler(*args)
^^^^^^^^^^^^^^
File "/home/heso/Desktop/projects/5city/web/server/main.py", line 46, in handle_get_config_data
check_is_auth(config['Telegram']['phone_number'], config['Telegram']['api_id'], config['Telegram']['api_hash'])
File "/home/heso/Desktop/projects/5city/web/server/main.py", line 29, in check_is_auth
client = TelegramClient(phone_number, api_id, api_hash)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/heso/.local/lib/python3.11/site-packages/telethon/client/telegrambaseclient.py", line 308, in __init__
session.set_dc(
File "/home/heso/.local/lib/python3.11/site-packages/telethon/sessions/sqlite.py", line 168, in set_dc
self._update_session_table()
File "/home/heso/.local/lib/python3.11/site-packages/telethon/sessions/sqlite.py", line 194, in _update_session_table
c.execute('delete from sessions')
sqlite3.OperationalError: database is locked



Hi all, I use Flask-SocketIO, and I need to integrate Telethon. However, when I input the basic code to connect to the session, I encounter an error. I found a similar question on Stack Overflow (https://stackoverflow.com/questions/51311383/python-flask-with-telethon), but it did not help me.

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

Telethon Chat

is there way to put reaction from telethon?

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

Telethon Chat

I created new sessions in the same group pirogram works, teleton does not

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

Telethon Chat

but why does pirogram receive messages correctly?

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