Repost messages from telegram to mastodon.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
605 B

from telethon import TelegramClient
import settings
async def main(client: TelegramClient):
me = await client.get_me()
print(
"Logged in as "
+ me.first_name
+ (" " + me.last_name if me.last_name else "")
+ "."
+ (
"\nLogged in as a bot! Bot cannot read channels to which it was not invited."
if me.bot
else ""
)
)
if __name__ == "__main__":
client = TelegramClient(
"tg2masto", api_id=settings.API_ID, api_hash=settings.API_HASH
).start()
client.loop.run_until_complete(main(client))