summaryrefslogtreecommitdiff
path: root/src/map/irc-bot.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2015-01-23 13:50:03 +0100
committerHaru <haru@dotalux.com>2015-01-24 14:37:26 +0100
commitdfe8337d9ddb1a0b356ae86de9955845d280b759 (patch)
treef13976e43362237a697216a09457c1fa0ea41fae /src/map/irc-bot.c
parent3cfc6ddac576e236ccad0497d8e2ed2ae827c2bb (diff)
downloadhercules-dfe8337d9ddb1a0b356ae86de9955845d280b759.tar.gz
hercules-dfe8337d9ddb1a0b356ae86de9955845d280b759.tar.bz2
hercules-dfe8337d9ddb1a0b356ae86de9955845d280b759.tar.xz
hercules-dfe8337d9ddb1a0b356ae86de9955845d280b759.zip
Added script command 'channelmes'
Special thanks to Dastgir Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/irc-bot.c')
-rw-r--r--src/map/irc-bot.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c
index 173675911..d492ad9ca 100644
--- a/src/map/irc-bot.c
+++ b/src/map/irc-bot.c
@@ -380,10 +380,16 @@ void irc_usernick(int fd, char *cmd, char *source, char *target, char *msg) {
* @param name Sender's name
* @param msg Message text
*/
-void irc_relay(char *name, const char *msg) {
- if( !ircbot->isIn )
+void irc_relay(const char *name, const char *msg)
+{
+ if (!ircbot->isIn)
return;
- sprintf(send_string,"PRIVMSG %s :[ %s ] : %s", channel->config->irc_channel, name, msg);
+
+ if (name)
+ sprintf(send_string,"PRIVMSG %s :[ %s ] : %s", channel->config->irc_channel, name, msg);
+ else
+ sprintf(send_string,"PRIVMSG %s :%s", channel->config->irc_channel, msg);
+
ircbot->send(send_string);
}