I was making a bot to connect to an irc for kicks and giggles and i was making it respond to different things, but i would like it to respond with the CTCP ACTION command, this is commonly known to a user as /me used for role playing or displaying action.
according to this great webpage about ctcp http://www.irchelp.org/irchelp/rfc/ctcpspec.html?
the format is \001ACTION barfs on the floor.\001
so i set up my bot to respond with
writer.WriteLine("PRIVMSG " + CHANNEL + " \001ACTION " + message + "\001");
i print out this result in my console as well, all it responds with is "No text to send"
which not really knowing what that is suppose to tell me, i assume the escape character is breaking the line early with the \0 totally ignoring the other 01 after it, so i have the bot print out in the console what ever it reads and i type /me dances and i read in the console
PRIVMSG CHANNEL :(odd symbol)ACTION message(odd symbol) i do not know what the odd symbols are but to me they look like smiley faces ..... after talking to a few people, i understand that the format is correct but the \001 may be different for different languages
so i look up what \001 could mean for c# and i fin \x01 and \0011 and the \0011 doesn't do anything and the \x01 also returns me the same response.... "No text to send"
I print "PRIVMSG " + CHANNEL + " \x01ACTION " + message + "\x01" to my console, and i the \x01 is replaced with the same smiley face character that it shows when i type /me dances and have my bot print out what it reads to the console...
my code for it is simply
if (type == MessageType.ActionMessage)
{
writer.WriteLine("PRIVMSG " + CHANNEL + " \x01ACTION " + message + "\x01");
Console.WriteLine("PRIVMSG " + CHANNEL + " \x01ACTION " + message + "\x01");
writer.Flush();
}
the writer object is not null, and writing it to my console is so i can see what happens
The ultimate question is, is this correct and if it's not what is the correct way to show an action via c# client to client protocol CTCP