A Discord bot to organize secret santa gift exchanges using the discord.py Python library + some other admin-type stuff for my server
pip3 install -r requirements.txt
Replace variables in CONFIG.py (I have provided CONFIG.py.example as an example)
3a. Replace discord_token
and client_id
in CONFIG.py with your bot token - these two are REQUIRED for all functionality and for the bot to even start
3b. Replace other variables as you want
role_channel
is REQUIRED for using reaction roles - will print an error in the console if left as -1
prefix
change it to whatever you want otherwise commands default to YOUR_PREFIX_HEREjoin, YOUR_PREFIX_HEREunpin_all, etc.
bot_folder
this is where the .cfg for the Secret Santa participants, the debug log, and the SQLite database files are stored
cfg_name
, dbg_name
, sqlite_name
don't need to do anything here unless you want to
min_budget
, max_budget
are used for the Secret Santa functionality and can be changed depending on what your Discord server agrees upon.
python3 santa-bot.py
To keep SantaBot running even after restart you can create a service.
run_santa.sh
to /usr/local/bin/
directoryrun_santa.sh
in /usr/local/bin
with your favorite editor to include the absolute path to the santa-bot.py script. For example /home/pi/Santabot/santa-bot.py
. If you're not sure the absolute, in the Santabot directory type pwd
sudo nano /usr/local/bin/run_santa.sh
- while true
- do
- python3 /home/pi/Santabot/santa-bot.py
- sleep 10
- done
santabot.service
using your favorite text editor and add the default user name to User=
and the Group they belong to in Group=
. To find out what default group a user belongs use id -gn usernamehere
nano santabot.service
- [Unit]
- Description=Santa Discord Bot
- [Service]
- User= root
- Group= root
- Restart=on-abort
- WorkingDirectory= "Full Path to Santa Bot Here"
- ExecStart= /usr/local/bin/run_santa.sh
- [Install]
- WantedBy=multi-user.target
/lib/systemd/system/
s!setprefs dog "stuffed rabbit" cat
)s!setwishlisturl amazonurl/123 "P Sherman 42 Wallaby Way" rightstufanime
)s!join
= join the Secret Santas!leave
= leave the Secret Santas![setwishlisturl|swlurl] [wishlist URL]
= set your wishlist URL (replaces current). You may also add your mailing address. wishlist URL is required.s![getwishlisturl|gwlurl]
= bot will PM you your current wishlists![setprefs|sprefs] [specific preferences, the things you like]
= set preferences (replaces current). Put N/A if none. preferences are required.s![getprefs|gprefs]
= bot will PM you your current preferencess![listparticipants|lp]
(admin only) = get the current participantss![totalparticipants|tp]
= get the total number of participantss!partnerinfo
= be DM'd your partner's informations!start
(admin only) = assign Secret Santa partnerss!restart
(admin only) = attempt to restart Secret Santa after pause without changing partnerss!pause
(admin only) = pause Secret Santa (will require s!start
and will reshuffle partners)s!end
(admin only) = end Secret Santas!assign_role_channel CHANNEL
(admin only) = change the channel the bot looks at for reaction roless!archive_pins SRC_CHANNEL DEST_CHANNEL
(admin only) = archive all pins from the source channel to the destination channel as messages (ex. s!archive_pins #general #archive
)s!unpin_all [CHANNEL_ID]
(admin only) = unpin all messages in the indicated channel (defaults to the channel the command is called in)s!emote [any number of emotes]
= returns the URL of the emote image/gif for conveniences![countdown|cd]
= set/check a countdown (global for the server, e.g. time until a Manga Club event) - help text is returns as neededs!ping
= check if bot is alives!echo
= make the bot say stuffs!ding
= dong