Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: emilmerle/FindingThingsWithPython
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: YorozuyaDev/FindingThingsWithPython
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 3 commits
  • 2 files changed
  • 1 contributor

Commits on Oct 3, 2020

  1. Copy the full SHA
    345c43d View commit details
  2. Copy the full SHA
    b804532 View commit details
  3. Copy the full SHA
    dbdd7c3 View commit details
Showing with 26 additions and 0 deletions.
  1. +4 −0 send_telegram_message/requirements.txt
  2. +22 −0 send_telegram_message/send_telegram_message.py
4 changes: 4 additions & 0 deletions send_telegram_message/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pyaes==1.6.1
pyasn1==0.4.8
rsa==4.6
Telethon==1.16.4
22 changes: 22 additions & 0 deletions send_telegram_message/send_telegram_message.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'''
Script to send message using Telegram
Yorozuya3 <yorozuya3@protonmail.com>
Licensed under MIT license
'''

from telethon import TelegramClient, sync
import argparse

#Usage python send_telegram_message.py "username, number or id" "message"
parser = argparse.ArgumentParser(description='Send message to telegram user from terminal')
parser.add_argument('user', type=str, help='Telegram username, number or id')
parser.add_argument('msg', type=str, help='Message to send to user')
args = parser.parse_args()

# These example values won't work. You must get your own api_id and
# api_hash from https://my.telegram.org, under API Development.
api_id =
api_hash = ''
client = TelegramClient('session_name', api_id, api_hash)
client.start()
client.send_message(args.user, args.msg)