Mbot is an IRC bot developed by Tommy Mathisen, designed purely for enjoyment and learning.
This project is a fun exploration into the world of IRC, and is currently still under development, with many features yet to be completed.
- Go 1.16 or later (recommended to use the latest version)
-
Clone the repository:
git clone https://github.com/mathisen99/Mbot.git cd Mbot
-
Rename the example configuration file:
mv data/config_example.json data/config.json
-
Run this command in the "main" channel the bot and you are present. This sets up all default permissions for the specified channel.
!managecmd setup #ChannelName
-
!managecmd edit <command> <role> <channels...>
Edits the specified command to be allowed for the given role in the listed channels. -
!managecmd add <command> <role> <channels...>
Adds a new command with specified role and channels. -
!managecmd remove <command> <role>
Removes the specified command for the given role. -
!managecmd list <command>
Lists all permissions for the specified command.
Users can be set to a specific role per channel. so they can have diffrent roles in diffrent channels. if no role is set users will be treated as "Everyone" role, this role is a generic one that defaults for everyone that does not have an role set.
You can manage users by adding or removing them using the following commands in the IRC channels the bot is in:
- Add User:
!adduser <nickname> <role> <channel>
- Remove User:
!deluser <nickname> <channel>
The following roles are supported:
Owner
: Highest privilege level.Admin
: Administrative privileges.Trusted
: Trusted user.BadBoy
: Restricted user.
!hello
Hello example command available to everyone.!url
Enables/disables URL features (YouTube, Wikipedia, etc.) for admins.!op <user> <channel>
Ops a user in the channel, admin only.!deop <user> <channel>
Deops a user in the channel, admin only.!voice <user> <channel>
Voices a user in the channel, admin only.!devoice <user> <channel>
Devoices a user in the channel, admin only.!kick <user> <channel>
Kicks a user from the channel, admin only.!ban <user> <channel>
Bans a user from the channel, admin only.!unban <user> <channel>
Unbans a user from the channel, admin only.!invite <user> <channel>
Invites a user to the channel, admin only.!topic <new_topic> <channel>
Changes the channel topic, admin only.!join <channel>
Bot joins the specified channel, admin only.!part <channel>
Bot parts from the specified channel, admin only.!shutdown
Shuts down the bot, owner only.!nick <new_nickname>
Changes the bot's nickname, owner only.
You can talk to the bot using the bots nickname and it will answer using the GPT-4o Model. This is still work in progress....
For certain features, you will need to have API keys for YouTube, IMDb, and VirusTotal. These keys should be stored in a .env
file or exported as environment variables.
-
YouTube API Key: You can get a YouTube API key by creating a project on the Google Developers Console. Enable the YouTube Data API v3 and generate an API key.
-
OMDb API Key: To obtain an OMDb API key, register for a free or paid account on the OMDb website. Once registered, you will receive an API key via email.
-
VirusTotal API Key: You can get a VirusTotal API key by signing up for a free account on the VirusTotal website. After logging in, navigate to your profile and generate an API key.
-
OpenAI API Key: You can obtain an OpenAI API key by signing up for an account on the OpenAI website. After logging in, navigate to the API section and generate an API key.
Create a .env
file in the root directory of the project with the following content:
YOUTUBE_API_KEY=your_youtube_api_key
OMDb_API_KEY=your_omdb_api_key
VIRUSTOTAL_API_KEY=your_virustotal_api_key
OPENAI_API_KEY=your_openai_api_key
Alternatively, you can set the environment variables directly.
setx YOUTUBE_API_KEY "your_youtube_api_key"
setx OMDb_API_KEY "your_omdb_api_key"
setx VIRUSTOTAL_API_KEY "your_virustotal_api_key"
setx OPENAI_API_KEY "your_openai_api_key"
export YOUTUBE_API_KEY="your_youtube_api_key"
export OMDb_API_KEY="your_omdb_api_key"
export VIRUSTOTAL_API_KEY="your_virustotal_api_key"
export OPENAI_API_KEY="your_openai_api_key"
- This bot uses the ErgoChat IRC library.
This project is licensed under the MIT License. See the LICENSE file for more details.