public class ServerResponseEvent extends Event
Numerics in the range from 001 to 099 are used for client-server connections only and should never travel between servers. Replies generated in response to commands are found in the range from 200 to 399. Error replies are found in the range from 400 to 599.
For example, we can use this event to discover the topic of a channel when we
join it. If we join the channel #test which has a topic of "I am King of
Test" then the response will be "
PircBotX #test :I Am King of Test
" with a code of 332 to
signify that this is a topic. (This is just an example - note that listening
for TopicEvent
is an easier way of finding the topic for a channel).
Check the IRC RFC for the full list of other command response codes.
PircBotX uses the class ReplyConstants, which contains constants that you may find useful here.
ReplyConstants
Constructor and Description |
---|
ServerResponseEvent(PircBotX bot,
int code,
String rawLine,
com.google.common.collect.ImmutableList<String> parsedResponse) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getCode()
The three-digit numerical code for the response.
|
com.google.common.collect.ImmutableList<String> |
getParsedResponse()
Parsed raw line.
|
String |
getRawLine()
The raw line of the response
|
int |
hashCode() |
void |
respond(String response)
Respond with a raw line to the server
|
String |
toString() |
compareTo, getBot, getId, getTimestamp
public void respond(String response)
respond
in interface GenericEvent
respond
in class Event
response
- The response to send@Generated(value="lombok") public int getCode()
@Generated(value="lombok") public String getRawLine()
@Generated(value="lombok") public com.google.common.collect.ImmutableList<String> getParsedResponse()
Copyright © 2010–2020 Leon Blakey. All rights reserved.