Source code of the bot of the french programming discord server NaN (Not a Name). https://discord.gg/zcWp9sC
- Luvit runtime
The bot reads its config from config.lua, which is git-ignored (don't commit your token).
-
Copy the default config:
cp config.lua.default config.lua
-
Edit
config.luaand set at minimum:Token— your Discord bot token, from the Discord Developer Portal (Bot tab > Reset/Copy Token).OwnerUserId— your Discord user ID (enable Developer Mode in Discord, right-click your name, "Copy ID").
For development, create a separate test bot application on the Discord Developer Portal and invite it to a private test server. Use this bot's token in your local config.lua file to ensure that no code runs on the production bot or server.
The bot requires all gateway intents except for guildIntegrations (see bot.lua). Two of these are privileged and must be enabled manually on the Developer Portal (under the "Bot" tab) for your application, or the bot won't work:
- Server Members Intent (
guildMembers) - Presence Intent (
guildPresences)
AutoloadModules lists which module_*.lua files load at startup — trim it while developing to only the module(s) you're working on, to reduce noise and side effects.
luvit bot.lua