Here is a short summary on how we create our Discord bots:
1) Create a new application on the Discord Dev site
2) Generate a Token under Bot -> Token (only visible once, so safe it!)
3) Using this token, you can develop your bot using the API for example through the discord.py library. See our discord-wordpress-bot or our discord-xp-bot for examples (only acessable through a member LDAP account)
4) Once your bot is developed, you need to create a invite link with the appropriate permissions. For this, go again into the Discord Dev site, and under Install, select the needed permissions for your bot. You can then use this link to add the bot to your server!
A few things about our setup. We use an automated GitLab CI/CD pipeline that builds and deploys on Git push to a dedicated server. Once the build stage is finished, it pushes the image to our GitLabs registry, where the deployment stage fetches it, sets the environment and config up and deploys the bot through a Docker compose. Over all I think the setup is really easy to develop with. As we often use AI tools for such smaller projects, to connect the whole Repo to Codex, a GitHub mirror of the GitLab is used (with simply two remotes added). This way, the workflow is:
– Generate code for a new feature through Codex
– Fetch changes from GitHub
– Push to GitLab
The build and deployment is then automatically handled. One of the bots already also has a test stage implemented in CI/CD, so that new commits dont break the system. But as always when having AI in the developing cycle: take a close look what is produced, dont blindly use the generated code and dont put too much trust into the LLM!
Automatically posted via our Discord bot. Original Discord author: Jakob. Discussion: open thread.