#
đŗ General preparationBefore you can start your own bot, you need to set up your own Discord-Bot and to generate your Moodle credentials. The following steps will guide you through this process. Then you will create the .env
file.
#
đ¤ Create a new Discord-BotBecause there is already a good instruction out there about how to set up a new discord bot, please follow all the steps described in this article.
The important points are:
- Save the token from step 7 (section 1). You will need it later for the environment variables (
DISCORD_TOKEN=
) - Give the bot all Text Permissions
#
đĢ Generate your new Moodle-TokenFor this step, you need an existing Moodle account (that can be yours). This account needs access to all courses you want to receive notifications from.
We created an online tool, to make it as simple as possible for you: Open fmdb.tjarbo.me and fill out the form to generate all required environment variables. Note, that no data will be stored or send to any other server than the submitted moodle server! Your credentials will be send to the official API of your moodle instance to receive a new token. You need the displayed results for the next step.
info
Right now, SSO is not official supported âšī¸ We need to figure out how to implement this authentication method. Lernraum Berlin ? -> Click here
#
ãī¸ Setup your environment variablesThis file contains the initial and background configuration of your FMDB. Create a new file .env
on your system and copy and paste the template from this page. There you can also find a description about each variable. Make sure that:
- You have entered the Discord token you saved from the first step.
- You have entered the Moodle values from the last step.
NODE_ENV
is set toPRODUCTION
- You changed
JWT_SECRET
to a very strong value !!! (You can use a password generator for this)
#
âī¸ What next ?Now you are ready to setup your own fmdb! You can choose between