raisedragon / pircbotx

Automatically exported from code.google.com/p/pircbotx
0 stars 0 forks source link

Listener Adapter for messages sent by the bot #57

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I think a method for that would be good, since I have so many send calls and I 
would like to know the channels it is going too.

Original issue reported on code.google.com by italian...@gmail.com on 29 Jan 2012 at 9:19

GoogleCodeExporter commented 9 years ago
Are you wanting to have a listener for each raw line the bot sends or just the 
channel messages?

The former I wouldn't mind doing, the latter though is such and edge case that 
I would recommend just overrideing onMessage and handling things there

Original comment by Lord.Qua...@gmail.com on 29 Jan 2012 at 11:31

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I am not understanding the 2nd part about overriding the onMessage? That is 
what I am doing overriding it. Cause I am making a logger and currently the 
onMessage is called just for other people's message, but not the bots own 
messages, so i think that the bot's own messages should be send then call 
onMessage.

Original comment by italian...@gmail.com on 29 Jan 2012 at 11:51

GoogleCodeExporter commented 9 years ago
Sorry, meant override sendMessage in the PircBotX class. You can log specifics 
there. Other useful methods might be sendRawLine and sendRawLineNow

Original comment by Lord.Qua...@gmail.com on 30 Jan 2012 at 2:36

GoogleCodeExporter commented 9 years ago
ok so i did override the 
sendMessage(Channel target, String message) and used super.sendMessage(target, 
message); 
so should that cover all the messages being sent to a channel? no Private 
messages will be logged

Original comment by italian...@gmail.com on 30 Jan 2012 at 5:11

GoogleCodeExporter commented 9 years ago
In that specific method yes. sendMessage(User user, String message) handles 
private messages

Marking as WontFix since that should of solved your problem

Original comment by Lord.Qua...@gmail.com on 30 Jan 2012 at 2:01