CnCNet_Bot_2.0 is a modular IRC bot built in C# for GameSurge / CnCNet channels.
It supports:
- Command-based architecture
- Admin controls
- Auto-voice system
- Scheduled messages
- Hostmask tracking
The bot is designed to be extendable and easy to maintain.
- Each command is a separate
.csfile inside/Commands - Uses a central
CommandManager - No need to touch core logic when adding commands
- Admins are stored in
admins.txt - One nickname per line
Example:
N8Diaz
CO2
- Admins can assign medals using:
!medal <nick> <type>
-
The bot:
- Saves hostmask in
voiced.txt - Auto-voices user on join
- Saves hostmask in
Medal types:
Platinum = 1
Gold = 2
Silver = 3
- Messages loaded from
messages.txt - Automatically sent in channel
Format:
Message text <priority>
Priority → interval mapping:
1 → 50 min
2 → 100 min
3 → 150 min
default → 200 min
Example:
Welcome to the ladder! 1
Stay active and have fun! 2
-
Tracks nick ↔ hostmask mappings in real time
-
Used for:
- Auto voice
- Future moderation features
- Messages reload automatically every 24 hours
- No restart needed
MedalBot/
│
├── Program.cs
├── Commands/
│ ├── CommandManager.cs
│ ├── ICommand.cs
│ ├── GambleCommand.cs
│ ├── MedalCommand.cs
│
├── Services/
│ ├── BotContext.cs
│ ├── AutoMessageService.cs
│ ├── HostmaskTracker.cs
│
├── credentials.ini
├── admins.txt
├── voiced.txt
├── messages.txt
| Command | Description | Example | Access |
|---|---|---|---|
| !gamble | Random choice | !gamble Coke Pepsi | Everyone |
| !medal | Add medal + autovoice | !medal N8Diaz Gold | Admin |
| !unmedal | Remove medal | !unmedal CO2 | Admin |
[IRC]
Nick=
User=
Pass=
Channel=
ChannelPass=
Server=
Port=
- Admin list (one per line)
- Auto-generated
- Stores hostmasks for voice system
Message text <priority>
- Create file in
/Commands:
PingCommand.cs
- Implement:
public class PingCommand : ICommand
{
public string Name => "ping";
public (bool handled, string response) Process(BotContext ctx, string sender, string message, string fullLine)
{
if (!message.StartsWith("!ping", StringComparison.OrdinalIgnoreCase))
return (false, null);
return (true, $"{sender}, pong!");
}
}- Register in
CommandManager.cs:
_commands.Add(new PingCommand());dotnet build
dotnet run
Or publish:
dotnet publish -c Release -r win-x86
- Bot responds only to commands starting with
! - Works even with prefixed IRC formatting
- Run from same directory as
.txtfiles - Uses UTC internally
- Uses shared
BotContextfor state - Services separated (AutoMessage, Hostmask)
- Commands isolated
- No full thread safety yet
- Scheduler is simple loop-based
- No persistence database (file-based only)
- Discord integration (alerts + logs)
- Ident/Nick tracking system
- Moderation alerts (bad words detection)
- Seen system
- Replay / event tracking
- Developed for CnCNet Red Alert 1 community
- Core system by CO2
- Architecture influence from N8Diaz bot framework