removed getTextBot() function and added textbot parameter to the CMD_BIND header...
[NeonServV5.git] / src / modules / NeonServ.mod / cmd_neonserv_csuspend.c
index 1dad37dd21fc5424399f238ea3a1260a11a90a66..cc90a2be778b5b8b16b9cef288c29fbf53a5787b 100644 (file)
@@ -25,7 +25,7 @@ CMD_BIND(neonserv_cmd_csuspend) {
     MYSQL_ROW row;
     char *channel = argv[0];
     if(!is_valid_chan(channel)) {
-        reply(getTextBot(), user, "NS_INVALID_CHANNEL_NAME", argv[0]);
+        reply(textclient, user, "NS_INVALID_CHANNEL_NAME", argv[0]);
         return;
     }
     int chanid;
@@ -34,17 +34,17 @@ CMD_BIND(neonserv_cmd_csuspend) {
     if ((row = mysql_fetch_row(res)) != NULL) {
         chanid = atoi(row[0]);
     } else {
-        reply(getTextBot(), user, "NS_UNREGISTER_NOT_REGISTERED", argv[0], client->user->nick);
+        reply(textclient, user, "NS_UNREGISTER_NOT_REGISTERED", argv[0], client->user->nick);
         return;
     }
     printf_mysql_query("SELECT `botid`, `bot_channels`.`id`, `suspended` FROM `bot_channels` LEFT JOIN `bots` ON `bot_channels`.`botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botclass` = '%d'", chanid, client->botid);
     res = mysql_use();
     if ((row = mysql_fetch_row(res)) == NULL) {
-        reply(getTextBot(), user, "NS_UNREGISTER_NOT_REGISTERED", argv[0], client->user->nick);
+        reply(textclient, user, "NS_UNREGISTER_NOT_REGISTERED", argv[0], client->user->nick);
         return;
     }
     if(!strcmp(row[2], "1")) {
-        reply(getTextBot(), user, "NS_CSUSPEND_ALREADY", channel);
+        reply(textclient, user, "NS_CSUSPEND_ALREADY", channel);
         return;
     }
     int botid = atoi(row[0]);
@@ -63,6 +63,6 @@ CMD_BIND(neonserv_cmd_csuspend) {
             module_global_cmd_unregister_neonbackup(channel);
     }
     printf_mysql_query("UPDATE `bot_channels` SET `suspended` = '1' WHERE `id` = '%s'", row[1]);
-    reply(getTextBot(), user, "NS_CSUSPEND_DONE", channel);
+    reply(textclient, user, "NS_CSUSPEND_DONE", channel);
     logEvent(event);
 }