2 Questions - Multiple Servers & Perform Action Without Trigger

52 views
Skip to first unread message

Xyspade

unread,
Jan 11, 2016, 11:03:23 PM1/11/16
to pircbotx
Hello everyone.  So, I am making a simple bot (for now) and, as the title suggests, have two simple questions.

1.  Can a PircBotX bot be run on multiple servers at once?  I would think two .addServer() methods in the configuration builder would achieve this, but no.

2.  I would like my bot to sometimes be able to send a message or perform another action without a trigger from another user or bot beforehand.  In order for a PircBotX bot to send a message to a channel, it relies on the MessageEvent from the onMessage() method or other method, as opposed to the sendMessage() method in PircBot working at any time, even in user-defined methods.  So let's say I want the bot to say something on its own without an Event being present; how would I go about doing this?  (I'm also asking on behalf of someone else I know who is wondering the same thing).

-Xyspade

Leon Blakey

unread,
Jan 12, 2016, 10:07:39 AM1/12/16
to pirc...@googlegroups.com
1) Yes PircBotX can run on multiple servers with MultiBotManager. This should probably be clarified in the docs

2) Using the events is done for convenience and to keep often used calls short. All of them though go through the String-based OutputIRC, under bot.sendIRC() or bot.send(). Eg to send a message to a channel you can use bot.send().message("#someChannel", "Hello");



--
You received this message because you are subscribed to the Google Groups "pircbotx" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pircbotx+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Xyspade

unread,
Jan 12, 2016, 10:26:50 PM1/12/16
to pircbotx
Alright, my second question has been answered; that method worked, thanks.

For the first question, I seem to be having some difficulty getting that to work.  Upon adding the sample code into main() (and of course renaming templateConfig to my variable name) I found that the MultiBotManager argument <PircBotX> is invalid and that the method buildForServer is undefined.

Configuration configuration = new Configuration.Builder()
If "Configuration" above were replaced with "Configuration.Builder" or "Configuration.Builder<PircBotX>" there would be errors.
Reply all
Reply to author
Forward
0 new messages