Xchat DCC Chat how to send a message using /msg

21 08 2008

I was working on a Xchat script in Perl that does some things based on the text received by a BOT over a DCC chat connection.

Creating a DCC chat session with the bot is easy and once the chat is connected a new tab is created with the nick of the bot where you can type in messages. The problem with the script was that their was obviously no tab and no human to type in the needed responses based on what the BOT was sending.

I looked this up and according to documentation once a DCC chat connection is established you can just use MSG to send messages over the link. So in the Perl script I was suppose to use: Xchat::command(“msg BOT-NAME MY MESSAGE”);. This didn’t work the message I just sent using the script was displayed in the tab as if I typed it in but the BOT didn’t respond. I also tried to type in “/msg BOT-NAME My message” again the same results. It was as if xchat got the message but didn’t send the message.

After a lot of searching around I found this Linux IRC mini-HOWTO by Frédéric L. W. Meunier and the following line of text in this howto: “/dcc chat nick starts a chat with nick. Use /msg =nick (notice the =) to send messages over the chat.

It turns out in Xhat 2.8.4 on Linux when using /msg over a dcc CHAT link you should add = to the nick you are sending a message to: Xchat::command(“msg =BOT-NAME MY MESSAGE”);. This solved my problem thanks Frédéric.