Skip to content

Commit c5b8197

Browse files
committed
Fixed security flaw with other tweet commands; Updated README
Signed-off-by: avaakash <as86414@gmail.com>
1 parent 18edff7 commit c5b8197

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
11
# Tweet From Message
2-
This application will tweet anything to forward to your Telegram bot.
3-
How to create Telegram Bot:
4-
How to get Twitter API keys:
2+
This application will tweet anything you forward to your Telegram bot.
3+
- How to create Telegram Bot: [Telegram Botfather](https://core.telegram.org/bots#6-botfather)
4+
- How to get Twitter API keys: [Twitter API docs](https://developer.twitter.com/en/docs/twitter-api)
55

6-
Give the tokens and keys to the env.json file (a sample is given, follow that naming convention only)
7-
Run the main.py file and voila, now send any text to your telegram bot and it will tweet it
8-
Or you can run the start.sh file to start a background process. And stop.sh to kill the process
6+
### Steps to Run
7+
1. Give the tokens and keys to the env.json file (a sample is given, follow that naming convention only)
8+
2. Run the start.sh script (or you can run the main.py file)
9+
3. Send a message to bot and it will tweet it.
10+
4. Run stop.sh to stop the bot server
911

10-
Telegram bot commands
11-
/start: displays a info message
12-
/delete: deletes the last tweet done through the bot
12+
### Telegram bot commands
13+
- /start: displays an info message
14+
- \<tweet\>: tweets the message
15+
- /delete: deletes the last tweet done through the bot
16+
- /comment \<tweet\>: adds a comment to the last tweet done through the bot
17+
18+
*Note*: change "\<tweet\>" with your tweet message
19+
20+
### Security
21+
The bot will only respond to specified telegram user ids only. Enter your telegram user ids in the env.json file.
22+
## Upcoming Features
23+
- Option to reply to comment tweet
24+
- Option to reply to any of the last 7 tweets
25+
- Last 7 tweet stats
26+
- Popular hashtag auto-addition
27+
- Option to like all retweets of the last 7 tweets

telegram_handler/tweet.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def send_tweet(update: Update, context: CallbackContext):
3737
else:
3838
update_message(update, context)
3939

40+
@restricted
4041
def delete_tweet(update: Update, context: CallbackContext):
4142
"""Delete a tweet command"""
4243
if update.message is not None:
@@ -52,6 +53,7 @@ def delete_tweet(update: Update, context: CallbackContext):
5253
else:
5354
update_message(update, context, "delete")
5455

56+
@restricted
5557
def comment_tweet(update: Update, context: CallbackContext):
5658
"""Tweets as a comment to the last tweet"""
5759
if update.message is not None:

0 commit comments

Comments
 (0)