Invite
What
The New Years Resolution Bot is a discord bot created to motivate users to log their new year resolutions, remind them about these resolutions and provide accountability and motivation to help achieve those goals.
How
The New Years Resolution Bot is coded in Pycord and Python MySQL Connector. The bot is coded to use entirely slash commands as a user interface for commands.
Where
This bot was initially created for one server however we now have compatibility for all servers. Here’s the invite.
Examples
Logging a new goal
Setting a reminder
Viewing the reminder set
Example reminder
Commands
/help
Displays a information about the capabilities of the bot as well as a list of commands and their uses
/get_started
Responds with a message explaining the basic commands to begin using the bot
/config_reminder_channel
Sets the server’s reminder channel to enable reminding
/newyeargoal <goal>
Logs a new goal
/remindme <days>
Instructs the bot how often to remind the user about their goals in days
/view_goals
Displays the users goals
/view_ids
Displays the users goals with their corresponding ID in the database. The ID is used for actions such as deleting a goal or marking it as achieved
/goal_achieved <ID>
Marks the goal with the specified ID as achieved
/stop_reminding
Instructs the bot to stop reminding the user of their goals T_T
/change_reminder_interval <days>
Changes how often the bot reminds the user
/next_reminder
Displays how often the user is being reminded and the date of their next reminder
/clear_goals
or /cleargoals <id>
Deletes all goals and reminders or deletes a specific goal and preserves reminders.
/edit_goals <id> <new_goal>
Edits a goal with the given id
Setup
Environment Variables
Create a .env
or set environment variables with the following values
The discord bot’s token TOKEN
MySQL DB information: MYSQLHOST
MYSQLUSER
MYSQLPASSWORD
MYSQLDATABASE
MYSQLPORT
Tools
The file *sqlConfig.py
contains the queries to create the four database tables used by the bot.*
2022_Goals
is used for storing each users goals as well as their user id and name, in the future it will also store the server ID of which the command was invoked in.
reminders
stores the uername, user id and how often (in days) the user wishes to be reminded.
nextDateReminder
stores the username, user id and next date each user should be reminded on.
config
stores server ids and their preferred reminder channel id
Folder Organisation
src
Contains all the bot’s source code. Including main.py
and the cogs
folder
tools
Contains database setup and migration programs.
data
Contains media assets used in the repositories readme’s
Other files
Dockerfile
Contains the instructions for the bot’s image build.
backlogs.md
Contains future features to work on (though the list is may not be complete)
Hosting
The bot is hosted using Docker run on a Network Attached Storage device.
While I no longer use RailwayApp, I still highly recommend it for free hosting.
Quick deploy on docker (on UNIX systems)
git clone https://github.com/TechWiz-3/newYearResolutionBot.git
cd newYearResolutionBot
nano ./env.list
enter env variablesbash tools/run_container
More info here
License
The New Year Resolution Bot is licensed under the GPL 3.0 license. See the LICENSE
file for more information.