This repository contains my first Discord bot project, built with Discord.js.
I created it a few years ago as a way to learn how to work with the Discord API, Node.js,
and later also experimented with a web panel connected via WebSocket.
- Basic moderation features such as ban and kick.
- Ability to set roles for users.
- Includes a simple dashboard / web panel (private use only).
- WebSocket connection between the bot and the panel for real-time updates.
- Written almost entirely in JavaScript.
This project is archived and no longer maintained.
It represents my first steps into Discord bot development and was mainly a learning project.
- The secrets, tokens, and API keys that were once stored in
.envandconfig.json
are no longer active and will not work anymore. - The bot is not intended to be used in production in its current state.
The bot was organized into different modules for easier maintenance:
-
Commands/ – Contains all bot commands:
ban.js– Ban a userkick.js– Kick a userunban.js– Unban a userclear.js– Clear messageshelp.js– Show help menuping.js– Check bot latencyserverinfo.js– Display server informationstatus.js– Show bot statusrole.js/role-dropdown.js– Manage user roleswelcomes.js– Welcome new memberschangelanguage.js/listlanguage.js– Change or list available languageschangeprefix.js– Change the bot prefixdisconnect.js– Disconnect from voicechannelnuker.js– (test/dev command, destructive)eval.js– Developer-only evaluation command
-
Events/ – Handles Discord events (e.g.
message,guildMemberAdd). -
SlashCommands/ – Early experiments with Discord slash commands.
-
Database/ – Contains the MySQL connection setup and the schema:
Guildstable: stores guild ID and owner ID.GuildConfigurabletable: stores configurable settings like prefix, language,
welcome channel, and up to three welcome roles.
-
Handler/ – Command and event loader.
-
Structures/ – Custom classes and utilities.
-
WebSocket (ws/) – Connection between the bot and the web panel.
The project was built with Node.js and used the following main dependencies:
discord.js(v13 dev build) – Core library for interacting with the Discord API@discordjs/voice,@discordjs/opus– Voice support@koenie06/discord.js-music– Music playback functionalityexpress,express-handlebars,body-parser– Web panel backend and templatingmysql,mysql2– Database connectiondotenv– Environment variable managementdiscord-oauth2– OAuth2 integration for the web panelnode-fetch,btoa– Utility libraries
This was my first Discord bot project, and it helped me understand the basics of
Discord.js, event handling, WebSocket communication, database integration, and how to
structure a Node.js application with both a bot and a web panel.
Archived project – pandaafx-bot (first Discord bot project)