Simplest way to identify bots within a MultiBotManager

12 views
Skip to first unread message

Peter Wedder

unread,
Feb 9, 2018, 6:17:57 PM2/9/18
to pircbotx
I'm writing a bot that has to be able to connect to multiple networks, and would like each PircBotX instance to be identifiable by the name of the network they're connected to. The networks would be defined in a configuration file, so the identifier used in that file (a string, eg. "freenode" or "quakenet") should ideally be traceable to a bot object somehow, so that a method such as sendMessage(String network, String channel) could be made to send a message to a specific channel on a specific network.

I could not find a way to perform this out of the box with the supplied MultiBotManager class. The closest thing I could spot were server addresses, but I would prefer using a config-specified network name, because server addresses are somewhat ephemeral, and would complicate things if one just wants to change the bot to a different server on the same network. Any ideas as to how I should go about this?
Reply all
Reply to author
Forward
0 new messages