Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added generate string #24

Open
wants to merge 2 commits into
base: user
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@

@BotzHubUser.on(events.NewMessage(incoming=True, chats=FROM))
async def sender_bH(event):

for i in TO:
try:
await BotzHubUser.send_message(
i,
event.message
)
print(event.message)
except Exception as e:
print(e)

Expand Down
17 changes: 17 additions & 0 deletions generate_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from telethon.sync import TelegramClient
from telethon.sessions import StringSession
from dotenv import load_dotenv
import os

# Replace these with your own values
api_id = os.getenv('API_ID')
api_hash = os.getenv('API_HASH')

def main():
print("Press Ctrl+C to stop this script")
with TelegramClient(StringSession(), api_id, api_hash) as client:
print("Session string:", client.session.save())
client.run_until_disconnected()

if __name__ == "__main__":
main()