This bot will pull a stream of tweets based on rules you set and automatically reply to them.

Overview

Twitter reply bot

This bot will pull a stream of tweets based on rules you set and automatically reply to them.

I built this bot in order to help combat scam bots in twitter, I am using this to look for the scam messages on the Tiktok support page and warn the original poster that it may be a scam.

Setup

In order to use this bot you will need to have a Twitter developer account, this can be requested from here https://developer.twitter.com/

once made you will need your API key, secret and generate a Bearer token. The bearer token is used to pull down the livestream of tweets but in order to post tweets it also requires the API key and Secret

this code only requires one module install but to ensure you have the correct version I recommend installing from the requirements file using the command below

python -m pip install -r requirements.txt

When you run the code it will provide a Twitter authorisation link and ask for a pin. When going to this link it will prompt you to allow the app access to the twitter account. This is how it authenticates for posting the reply's and it will use the account you authorise for the posts. This prompt will happen every time you run the code allowing to to easily change which account posts the replies.

NOTE: make sure to check which account you are authorising to post. I have accidentally used my personal account while testing this by not paying attention at this stage

Setting rules

The bot will reply to any message that match on the rules list within the code (This is under the Main function at the bottom)

Below is the rule set that I used to test against the Tiktok Support twitter looking for scam messages

  sample_rules = [
        {"value": "TikTokSupport DM Instagram -from:cybersafetybot1"},
        {"value": "TikTokSupport on Instagram helped me -from:cybersafetybot1"},
        {"value": "TikTokSupport via IG -from:cybersafetybot1"},
        {"value": "TikTokSupport inbox recover -from:cybersafetybot1"},
        {"value": "TikTokSupport referred to unbanned -from:cybersafetybot1"},
        {"value": "TikTokSupport send a message to -from:cybersafetybot1"},
        {"value": "TikTokSupport recovered my account for me -from:cybersafetybot1"},
        {"value": "TikTokSupport my account got same issues -from:cybersafetybot1"},
    ]

The each line is a separate rule and works independantly from each other. the stream will find tweets that contain any of the words within the value section. the flag -from:cybersafteybot1 means that it will ignore messaged from the account CyberSafteybot1 Ensure to add your account into this field so that the bot doesnt flag your replies. For more information on Rule Operators and constructs see here https://developer.twitter.com/en/docs/twitter-api/tweets/filtered-stream/integrate/build-a-rule

You might also like...
Nyon-stream - A python script that uses webtorrent to stream nyaa videos directly to mpv

nyon-stream A rather shitty script that uses webtorrent to stream nyaa videos di

❄️ Don't waste your money paying for new tokens, once you have used your tokens, clean them up and resell them!
❄️ Don't waste your money paying for new tokens, once you have used your tokens, clean them up and resell them!

TokenCleaner Don't waste your money paying for new tokens, once you have used your tokens, clean them up and resell them! If you have a very large qua

And now, for the first time, you can send alerts via action from ArcSight ESM Console to the TheHive when Correlation Rules are triggered.

ArcSight Integration with TheHive And now, for the first time, you can send alerts via action from ArcSight ESM Console to the TheHive when Correlatio

A Twitter Bot that retweets and likes tweets with the hashtag #girlscriptwoc and #girlscript, and also follows the user.
A Twitter Bot that retweets and likes tweets with the hashtag #girlscriptwoc and #girlscript, and also follows the user.

GirlScript Winter of Contributing Twitter Bot A Twitter Bot that retweets and likes tweets with the hashtag #girlscriptwoc and #girlscript, and also f

It is a temporary project to study discord interactions. You can set permissions conveniently when you invite a particular disk code bot.
It is a temporary project to study discord interactions. You can set permissions conveniently when you invite a particular disk code bot.

Permission Bot 디스코드 내에 있는 message-components 를 연구하기 위하여 제작된 봇입니다. Setup /config/config_example.ini 파일을 /config/config.ini으로 변환합니다. config 파일의 기본 양식은 아

Video Stream is a telegram bot project that's allow you to play video on telegram group video chat
Video Stream is a telegram bot project that's allow you to play video on telegram group video chat

Video Stream is a telegram bot project that's allow you to play video on telegram group video chat 🚀 Get SESSION_NAME from below: Pyrogram ## ✨ Featu

Video Stream: an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat
Video Stream: an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat

Video Stream is an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat 🧪 Get SESSION_NAME from below: Pyrogram

Video Stream: an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat
Video Stream: an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat

Video Stream is an Advanced Telegram Bot that's allow you to play Video & Music

Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency.
Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency.

Elonbot Trading bot that uses Elon Musk`s tweets to know when to buy cryptocurrency. Here is how it works: Subscribes to someone's (elonmusk?) tweets

Owner
Brains
Brains
One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind them.

AwesomeVersion One version package to rule them all, One version package to find them, One version package to bring them all, and in the darkness bind

Joakim Sørensen 39 Dec 31, 2022
null 471 Dec 24, 2022
Telegram Client and Bot that use Artificial Intelligence to auto-reply to scammers and waste their time

scamminator Blocking a scammer is not enough. It is time to fight back. Wouldn't be great if there was a tool that uses Artificial Intelligence to rep

Federico Galatolo 6 Nov 12, 2022
Discord Bot that can translate your text, count and reply to your messages with a personalised text

Discord Bot that can translate your text, count and reply to your messages with a personalised text

Grizz 2 Jan 26, 2022
Wechat based auto reply with pyautogui

Python-微信 自动回复 练手~ 一直想做个给微信发个消息,就可以跑Python程序,并将结果发送给我的东西,之前看了 B站@不高兴就喝水 的视频,终于有了灵感~ 使用的是模拟点击方案,请求期间是不能操作了。 库 pyautogui 用于模拟鼠标键盘操作和定位操作位置 pyperclip 剪贴板

Vito Song 1 Oct 22, 2022
📢 Video Chat Stream Telegram Bot. Can ⏳ Stream Live Videos, Radios, YouTube Videos & Telegram Video Files On Your Video Chat Of Channels & Groups !

Telegram Video Chat Bot (Beta) ?? Video Chat Stream Telegram Bot ?? Can Stream Live Videos, Radios, YouTube Videos & Telegram Video Files On Your Vide

brut✘⁶⁹ // ユスフ 15 Dec 24, 2022
A stock information collector and parser for Taiwan and US market. Automatically send LINE message if the pre-defined rules are triggered.

agastock 開發動機 就在海運飆漲的2021年7月,差點跪在地上喜迎財富自由的當下,EPS超高好消息不斷的長榮竟然套在202元一去不回,有圖有真相(哭) 忽然體會到追高殺低不是辦法,魯蛇我得靠邏輯分析也能出頭天,經過三個月無數個不出門的周末,產出簡單的爬蟲和分析工具。 上過金融研訓院的量化交易

Gavin Lee 12 Nov 16, 2022
Archive tweets and make them searchable

Tweeter Archive and search your tweets and liked tweets using AWS Lambda, DynamoDB and Elasticsearch. Note: this project is primarily being used a tes

Kamil Sindi 8 Nov 18, 2022
The purpose of this bot is to take soundcloud track requests, that are posted in the stream-requests channel, and add them to a playlist, to make the process of scrolling through the requests easier for Root

Discord Song Collector Dont know if anyone is actually going to read this, but the purpose of this bot is to check every message in the stream-request

null 2 Mar 1, 2022
Script to automatically book a vaccine slot on Doctolib for today or tomorrow, following rules from the French Government.

DOCTOSHOTGUN This script lets you automatically book a vaccine slot on Doctolib for today or tomorrow, following rules from the French Government. Pyt

Romain Bignon 560 Dec 19, 2022