johnmaguire / Cardinal

A Python IRC bot, designed to make adding functionality quick and simple. (est. 2013)
MIT License
100 stars 38 forks source link

Ability to join multiple servers from one running instance #133

Open ameygat opened 7 years ago

ameygat commented 7 years ago

If I run single instance of the program Can I use config something similar to :

config.json


{
    "nickname": "Cardinal321",
    "password": "",
    "network": "irc.spotchat.org",
    "server_password": "",
    "port": 6667,
    "ssl": false,
    "storage": "storage/",
    "channels": [
        "#test321","test4321"
    ]
},
{
    "nickname": "Cardinal321",
    "password": "",
    "network": "irc.freenode.net",
    "server_password": "",
    "port": 6667,
    "ssl": false,
    "storage": "storage/",
    "channels": [
        "#test3214"
    ]
}
johnmaguire commented 7 years ago

Unfortunately no, you must use multiple instances of Cardinal. You can create multiple configs and use the --config option to point Cardinal at a file other than config.json. I'd suggest running Cardinal under something like supervisord anyway. :)

I have this pipe dream task, #93 that may result in something more similar to what you are looking for, depending on if it ever gets completed, and what the final result looks like. The only real advantage I see to having Cardinal connect to multiple servers is to allow the bot to relay messages from one server to another however. Maybe that is worth it -- maybe it makes more sense to use something like Redis PUB/SUB to communicate between two instances and do it that way. I'm hesitant to make the config more complex than it already is. When tackling #93, I ran into a lot of weird edge cases while trying to flesh out the config system more.