Discord Bot
This is the official bot for my community Discord server.
NOTE: This repository is very barebones at present as I am in the process of slowly rewriting my "Discord Bot from Scratch" (a bot made in Node.js without any third-party libraries) from my personal Git server and publishing that here.
This contains my custom implementation of RFC 6455: The WebSocket Protocol in the websocket
directory, as Node.js does not have a native client.
Running
The official bot used in my Discord server is not public, so you need to create your own Discord Bot Application.
Also do note that since this bot is tailored towards my community, running your own instance of it may prove troublesome.
Development
- Clone this repository (
git clone https://github.com/viral32111/discordbot.git
). - Open the directory in Visual Studio Code.
- Populate the environment variables in the .env file with appropriate values.
- Either Run & Debug using the provided launch configuration, or open the Integrated Terminal and run
npm start
.
Production
Docker images are built and published to this repository's container registry every time a commit is pushed.
To download and start a container in a single command, run the following:
docker run \
--name discordbot \
--volume discordbot:/var/lib/bot \
--env-file ./my-environment-variables \
--interactive --tty \
ghcr.io/viral32111/discordbot:latest
Persistent data is stored in /var/lib/bot
, so this directory will need to be mounted in a volume, or as a bind mount.
See the environment variables file for a list of environment variables that are required. These can be passed through either the --env NAME=VALUE
or --env-file FILE
flags.
History
Over the years, this bot has gone through countless language changes, complete rewrites, and branding changes. I have done my best to collate a small list of them below, but do note that the dates are rough estimates.
Sadly, half of these are not in this repository's commit history as I either worked on them in private without Git, on my personal Git server, or in a separate repository which has since been deleted.
Conspiracy AI
This was the original bot back when the community was branded as Conspiracy Servers, its name was carried over from an automation bot we used on the MyBB forums before we made the move to Discord.
- 2016: RedBot with custom configurations (a temporary bot until I started coding my own).
- 2016/2017: Started with C# on the .NET Framework using Discord.NET.
- 2017 (
1.0.0
?): Moved to Python using discord.py, as I did not like Discord.NET's command-oriented approach to everything. - 2017-2019 (
2.0.0
?): Stayed on Python for a while, but went through about half a dozen major rewrites. - 2019/2020: Tried out Node.js using discord.js, but I did not like it so this was quickly abandoned.
- 2021 (
3.0.0
): Continued to use Python, also published a release.
Suimin
This is the current bot for the community, which started when the community was rebranded to viral32111's community.
- June 2021: Continued to use the latest version of Conspiracy AI's code in Python with discord.py, with a few minor changes.
- 2021 (
4.0.0
?): discord.py got deprecated, so I tried out Node.js again, but this time without discord.js or any third-party libraries, this went great but was never finished and thus never published. - 2021: Tried making a low-level bot in C, but I ended up abandoning it when it came to coding a JSON parser.
- 2022 (
5.0.0
): Went back to the no libraries bot using Node.js as it was the most successful, moved it over to TypeScript, and continued to use it.
License
Copyright (C) 2016-2023 viral32111.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses.