Discord Availability is a discord bot used to track who will be available for a certain event (i. e. a game).
- PHP v8.1 (v8.2 works but produces deprected notices)
- Composer
-
Setup configuration
Copy
config-example.json
to either~/.config/discord-availability/config.json
or/etc/discord-availability/config.json
. -
Run the script
php availability.php
Do not attempt to run this via a web server (i. e. from the browser), it will only work from the command line.
-
Add it to your server
-
Create an app (key) for your server: https://discord.com/developers/applications
-
Set the OAuth scope to
identify
bot
-
Copy the generated URL and follow the link to add it to your server. It should look like this:
https://discord.com/api/oauth2/authorize?client_id=XXXXXXXXXXXXXXXXXXX&permissions=0&redirect_uri=https%3A%2F%2Fgithub.com%2Fgrandeljay%2Fdiscord-availability&response_type=code&scope=identify%20applications.commands%20bot
-
Once started, the script will run in loop, indefinitly until stopped. A schedule/cron is not necessary.
The bot currently offers three different slash commands:
/available <date>
wheredate
is astrtotime
compatible phrase. According to PHP that is: about any English textual datetime description./unavailable <date>
wheredate
is astrtotime
compatible phrase. According to PHP that is: about any English textual datetime description./availability
which lists the availability of everybody. Everybody in this case means users who have used the/available
or/unavailable
command at least once./shutdown
which shuts the bot down. You must be an administrator to do this. Using this before restarting the bot will speed up the process significantly.
Once a user is in the system, the bot will automatically assume the user is available unless he specifies otherwise.
Furthermore, the bot will attempt to detect the availability of users based on their messages (outside of the slash commands). This applies to all users who have used the /available
or /unavailable
command at least once.
-
--install
Updates all of the discord slash commands. Unused/orpahned commands are removed and new ones are added.
If you are a bro who is hosting this for a bro, you da real MVP.