Can you help me translate this python code and let me see how the example is written? Thank you
AtlantisDe opened this issue · 2 comments
AtlantisDe commented
Can you help me translate this python code and let me see how the example is written? Thank you
- python
import telethon
from telethon import TelegramClient, events, sync
api_id = 123
api_hash = 'hi Numpy.NET'
client = TelegramClient('Null', api_id, api_hash)
client.start()
print(client.get_me().stringify())
messages = client.get_messages('elon.....')
print(messages)
@client.on(events.NewMessage(pattern=r'.*'))
async def handler(event):
sender = await event.get_sender()
print(event.text)
try:
print('(Press Ctrl+C to stop this)')
client.run_until_disconnected()
finally:
client.disconnect()
- Numpy.NET
var socks = Python.Runtime.Py.Import("socks");
var telethon = Python.Runtime.Py.Import("telethon");
var api_id = 123;
var api_hash = 'hi Numpy.NET';
var client = telethon.TelegramClient(@
//........ how to...coding ths
henon commented
Why do you even bother with Python? Why not directly use a .NET client for Telegram?
AtlantisDe commented
Why do you even bother with Python? Why not directly use a .NET client for Telegram?
Because I need to be compatible with Session ..python session and td..session.. So I need two runtime environments..