Mishnabot is a Discord bot that posts a random mishnah sugye once per day (except on Shabbos). The bilingual Mishnah text was scraped from Sefaria.
This software uses the MIT license, which you can read here.
This software was originally made for Shel Maala in order to enable the creation of the Queer Talmud. Alternative use cases, such as the study of the non-queer Talmud, are theoretically possible but not actively supported by the developers. Usage of this software to suppress the Queer Talmud is prohibited.
The user of this software may not be an individual or entity, or a representative, agent, affiliate, successor, attorney, or assign of an individual or entity, identified by the Boycott, Divestment, Sanctions ("BDS") movement on its website (https://bdsmovement.net/ and https://bdsmovement.net/get-involved/what-to-boycott) as a target for boycott. Source: The Hippocratic License
- A remote server
- On your computer, git and Python 3.6 or newer
- On the server, Python 3.6 or newer
- Admin privileges on the target Discord server
- Create a Discord bot.
- Get the ID of the channel you want the bot to post to.
- Get the OAuth2 client ID of the bot (you'll need this in order to add it to the channel).
- Add the bot to the channel. (Replace the client ID with your bot's client ID)
- Get Python running on your server. How to do this will vary depending on the webhost.
- Make sure you can ftp and ssh into the server.
- Clone this repo. The rest of this documentation assumes that you've cloned the repo to
~/mishnabot
where~
is your home directory. - Create a file named
secrets.txt
in the same directory as this file, formatted like this:
ssh_username=USERNAME
ssh_password=PASSWORD
ftp_username=USERNAME
ftp_password=PASSWORD
ftp=ftp.URL
hostname=URL
ssh_cwd=URL/PATH
USERNAME
andPASSWORD
are your login credentials.URL
is the server url, for examplemy_server.com
URL/PATH
is the path to the directory where the Discord bot should be uploaded. The.htaccess
file will be uploaded here and everything else will be uploaded toURL/PATH/public/
.
- Create a file named
bot_secrets.txt
in the same directory as this file, formatted like this:
token=BOT_TOKEN
channel=CHANNEL_ID
In a terminal:
cd ~/mishnabot
python3 ftp.py
This will upload mishnabot to your server. On Windows, runpy -3 ftp.py
instead.ssh USERNAME@SERVER
cd path/to/mishnabot
python3 -m pip install -e .
timedatectl
to get the timezone of your server.crontab -e
- Add this line to the crontab file:
0 15 * * 0-5 python3 ~/PATH/run.py > ~/path/to/log.txt
Replace 15
(3:00 PM) with the correct time.
Replace PATH
with the actual path on the server, for example ~/my_server.com/public/run.py
- To exit nano,
ctrl+x
andy
andenter
exit
- Removed
launch.py
- Removed
get_log.py
- Removed
get_process.py
- Removed
ssh.py
- Removed
spur
requirement - Refactored most of
run.py
so that it works via crontab
- Fixed:
run.py
args--shomer
and--logging
aren't actually used. - Added arg
--shabbos
torun.py
andBot
to set which day is Shabbos.
Minor changes
- Added parameter
shomer
toBot
andrun.py
. If True, don't post on Shabbos - Added parameter
logging
toBot
andrun.py
If True, log messages- Added logging to
Bot
- Added logging to
- Moved ssh code to
mishnabot.ssh.py
- Added
get_log.py
andget_process.py
to check on the bot's status
- Added
- Renamed
ssh.py
tolaunch.py
- Explicitly set which files get uploaded via
ftp.py