add set options for nick, user, host and realname
This commit is contained in:
parent
d513fbdc63
commit
e16bc09108
4 changed files with 42 additions and 1 deletions
|
@ -10,6 +10,7 @@ StupidServ Module for NeoStats Changelog.
|
|||
- Use core bot message handler to process commands (M)
|
||||
- We now try to read nick, user, host and realname so these can be configured more
|
||||
easily (M)
|
||||
- SET interface for nick/user/host/realname added (M)
|
||||
|
||||
1.2 - Fish
|
||||
- Ident should be shorter than 8 chars as per RFC
|
||||
|
|
25
s_help.c
25
s_help.c
|
@ -95,3 +95,28 @@ const char *s_help_about[] = {
|
|||
"warez - Ian Johnston",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ss_help_set_nick[] = {
|
||||
"NICK <newnick> Change bot nickname",
|
||||
"(requires restart to take effect).",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ss_help_set_user[] = {
|
||||
"USER <username> Change bot username",
|
||||
"(requires restart to take effect).",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ss_help_set_host[] = {
|
||||
"HOST <host> Change bot host",
|
||||
"(requires restart to take effect).",
|
||||
NULL
|
||||
};
|
||||
|
||||
const char *ss_help_set_realname[] = {
|
||||
"REALNAME <realname> Change bot realname",
|
||||
"(requires restart to take effect).",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
13
ss.c
13
ss.c
|
@ -60,6 +60,17 @@ static bot_cmd ss_commands[]=
|
|||
{"ABOUT", s_about, 0, 0, s_help_about, s_help_about_oneline },
|
||||
{NULL, NULL, 0, 0, NULL, NULL}
|
||||
};
|
||||
|
||||
static bot_setting ss_settings[]=
|
||||
{
|
||||
{"NICK", &s_StupidServ, SET_TYPE_STRING, 0, MAXNICK, NS_ULEVEL_ADMIN, "Nick", NULL, ss_help_set_nick },
|
||||
{"USER", &ss_cfg.user, SET_TYPE_STRING, 0, MAXUSER, NS_ULEVEL_ADMIN, "User", NULL, ss_help_set_user },
|
||||
{"HOST", &ss_cfg.host, SET_TYPE_STRING, 0, MAXHOST, NS_ULEVEL_ADMIN, "Host", NULL, ss_help_set_host },
|
||||
{"REALNAME",&ss_cfg.rname, SET_TYPE_STRING, 0, MAXREALNAME, NS_ULEVEL_ADMIN, "RealName",NULL, ss_help_set_realname },
|
||||
{NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Module info descriptor
|
||||
*/
|
||||
|
@ -77,7 +88,7 @@ ModuleInfo __module_info = {
|
|||
static int Online(char **av, int ac)
|
||||
{
|
||||
ss_bot = init_mod_bot(s_StupidServ, ss_cfg.user, ss_cfg.host, ss_cfg.rname,
|
||||
services_bot_modes, BOT_FLAG_DEAF, ss_commands, NULL, __module_info.module_name);
|
||||
services_bot_modes, BOT_FLAG_DEAF, ss_commands, ss_settings, __module_info.module_name);
|
||||
return 1;
|
||||
};
|
||||
|
||||
|
|
4
ss.h
4
ss.h
|
@ -33,3 +33,7 @@ extern const char *s_help_convert[];
|
|||
extern const char *s_help_list[];
|
||||
extern const char *s_help_version[];
|
||||
extern const char *s_help_about[];
|
||||
extern const char *ss_help_set_nick[];
|
||||
extern const char *ss_help_set_user[];
|
||||
extern const char *ss_help_set_host[];
|
||||
extern const char *ss_help_set_realname[];
|
||||
|
|
Reference in a new issue