MiniBots is a Discord bot written in C# utilizing the DSharpPlus library that allows users to create and run small Lua scripts (referred to as "MiniBots") within a Discord server.
Before you can use the MiniBots Discord Bot, make sure you have:
- .NET Core SDK installed
- A Discord Bot Token (you can obtain one here)
- Clone the repository:
git clone https://github.com/Markussim/mini-bots.git
- Navigate to the cloned directory.
- Copy
appsettings.json.example
toappsettings.json
and enter your Discord token. - Compile and run the bot:
dotnet run
- Clone the docker image:
docker pull ghcr.io/markussim/mini-bots:latest
- Start the docker container:
Optional Environments Variables:
docker run -d -e DISCORD_TOKEN=<discord token> -v ./database:/App/Database mini-bots:latest
- DISCORD_GUILDID
- DISCORD_PREFIX
Type the command ?bot <name> \n```lua \n<code> \n```
to create a new MiniBot with the specified Lua code
. Make sure to replace <name>
and <code>
with the actual bot name and Lua script.
Example:
?bot Ping_Pong
```lua
if string.lower(messageManager.Content) == "ping" then
return "pong"
end
```
More examples can be found in the examples folder.
Use the /help
command to get information on how to use the bot.
Be aware that allowing users to run custom code on your server can be potentially dangerous. The current implementation does not include security measures against malicious code or to sandbox the Lua environment. You should introduce proper security features before using this bot in a live environment.
Contributions are welcome! If you wish to contribute, please submit a pull request or create an issue on the repository.
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
- Thanks to the creators of DSharpPlus for their Discord API wrapper for C#.
- The NLua team for providing a bridge between .NET and Lua with the NLua library.