A Twitter bot that can read your DMs, then tweets like Twitter autobase. This project is a re-code of autodm_base by Prieyudha Akadita S. with many improvements and fixed bugs. This project is under MIT License. You can try on my autobase account @autobase_reborn.
All updates will be postponed until June 2021 (or sooner). Feel free to make issues or pull requests if you have any questions, feature requests, or bugs.
- New Features
- Requirements
- How to run this bot?
- DMs examples (based on administrator_data)
- Notes
- Contributing
- License
- Blacklist words
- Only followed by account that can send menfess
- Auto accept message requests
- Notify sender when the menfess sent or not
- Tweet GIF and video
- Post a Thread when characters > 280
- Sync simple database (json) on github repository
- Setting account from DM
- Upload more than 4 media
- Trigger words are not case-sensitive
- Control multiple accounts [example]
- etc. see on administrator_data
- Good at basic python programming
- Python 3.8.x
- Twitter Developer Account
- Github Account
- Heroku Account
- Install pip3, virtualenv, git, heroku
- Do Installation
- Edit contents on administrator_data.py
- Deploy to Heroku
Note: You can run this bot on Windows and MacOS as well
Open your Linux terminal on the specified folder
# Clone this repository or download released version on https://github.com/fakhrirofi/twitter_autobase/releases
git clone https://github.com/fakhrirofi/twitter_autobase.git
virtualenv twitter_autobase
cd twitter_autobase
. bin/activate
pip3 install -r requirements.txt
Make .gitignore file
lib/
bin/
__pycache__/
pyvenv.cfg
# add another, up to you
After modifying contents on administrator_data, run app by using syntax: python3 app.py
Make sure you have deleted the local Database if you previously ran the bot on local.
git add .
git commit -m "first commit"
heroku git:remote -a your_heroku_app_name
git push heroku master
- 550 free dyno hours, you can upgrade to 1000 hours by adding credit card to your account.
- Dyno cycling (restart), so
add_admin
,rm_admin
,add_blacklist
,rm_blacklist
,switch on/off
, and all temporary db (including Github database) won't work perfectly. It would be better if you use Heroku database services e.g. Postgres. Please settingBlacklist_words
,Admin_id
, and etc. before deploying to Heroku. Database will be changed to Postgres in future updates.
You can tweet more than one media with media link on tweet. Open your twitter app then tap (hold) the tweet. Media link automatically will be copied, then send the link to this bot from DM.
fess! your message https://twitter.com/username/1234567890?s=19
(by attaching media, url, or not)
fess! Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
(by attaching media, url, or not)
fess! your message
(by attaching media, url, or not)
Note: Due to Heroku dyno cycling, some commands that use temporary data won't work perfectly.
Only admin can access these commands. If user try to access this commands, the user will be notified that the
keyword is wrong.
#add_blacklist word1 word2 word-n
#rm_blacklist word1 word2 word-n
#db_update
not available when Database = False
#display_blacklist
#rm_followed username1 username2 username-n
#add_admin username1 username2 username-n
#rm_admin username1 username2 username-n
#who https://twitter.com/username/status/1234567890?s=19
check who was sent the menfess
#switch off
turn off the automenfess
#switch on
turn on the automenfess
For add_blacklist and rm_blacklist, you can add space into your words by giving underscore "_". Example:
#add_blacklist _word1_ word2_word3 word-n
This command will append " word1 ", "word2 word3", and "word-n" to Blacklist words list.
#delete https://twitter.com/username/status/1234567890?s=19
Only sender who has sent the menfess that can delete the mentioned tweet link, admin pass this filter.
- Admin pass all filters
- Only admin that can setting account with admin command
- All temporary data only available for one day (reset at midnight or heroku dyno cycling)
- If you use github repository to deploy to heroku, make sure to set the repository to private. Github automatically will delete your github token if your repository is public
- Keywords are not case-sensitive (upper, lower, capitalize)
- See changelogs on releases's notes
- I have written documentation in administrator_data
This works by sending welcome message to new followers, so Sender must follow the bot. In the beginning, it fills 100 followers to tw.follower. So it can't track new followers when the bot was just started. If your followers didn't receive a welcome message from the bot. Unfollow this bot for some minutes then follow it again.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. To make a pull request, see the GitHub documentation on creating a pull request.
Copyright (c) 2020- Fakhri Catur Rofi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.