]>
Commit | Line | Data |
---|---|---|
1 | #include <stdio.h> | |
2 | #include <time.h> | |
3 | ||
4 | #include "../nick/nick.h" | |
5 | #include "../localuser/localuserchannel.h" | |
6 | #include "../core/hooks.h" | |
7 | #include "../core/schedule.h" | |
8 | #include "../lib/array.h" | |
9 | #include "../lib/base64.h" | |
10 | #include "../lib/irc_string.h" | |
11 | #include "../lib/splitline.h" | |
12 | ||
13 | #include "qabot.h" | |
14 | ||
15 | int qabot_showhelp(nick* np, char* arg) { | |
16 | if (!ircd_strcmp(arg, "showcommands")) { | |
17 | sendnoticetouser(qabot_nick, np, "Syntax: showcommands"); | |
18 | sendnoticetouser(qabot_nick, np, "Display commands the bot provides."); | |
19 | } | |
20 | else if (!ircd_strcmp(arg, "help")) { | |
21 | sendnoticetouser(qabot_nick, np, "Syntax: help <command>"); | |
22 | sendnoticetouser(qabot_nick, np, "View help for a particular command."); | |
23 | } | |
24 | else if (!ircd_strcmp(arg, "hello")) { | |
25 | sendnoticetouser(qabot_nick, np, "Syntax: hello"); | |
26 | sendnoticetouser(qabot_nick, np, "Create the initial user account on the bot."); | |
27 | } | |
28 | else if (!ircd_strcmp(arg, "save")) { | |
29 | sendnoticetouser(qabot_nick, np, "Syntax: save"); | |
30 | sendnoticetouser(qabot_nick, np, "Save the user and bot databases."); | |
31 | } | |
32 | else if (!ircd_strcmp(arg, "listbots")) { | |
33 | sendnoticetouser(qabot_nick, np, "Syntax: listbots"); | |
34 | sendnoticetouser(qabot_nick, np, "List currently added bots."); | |
35 | } | |
36 | else if (!ircd_strcmp(arg, "listusers")) { | |
37 | sendnoticetouser(qabot_nick, np, "Syntax: listusers"); | |
38 | sendnoticetouser(qabot_nick, np, "List currently added users."); | |
39 | } | |
40 | else if (!ircd_strcmp(arg, "showbot")) { | |
41 | sendnoticetouser(qabot_nick, np, "Syntax: showbot <nick>"); | |
42 | sendnoticetouser(qabot_nick, np, "Show information about a particular bot."); | |
43 | } | |
44 | else if (!ircd_strcmp(arg, "addbot")) { | |
45 | sendnoticetouser(qabot_nick, np, "Syntax: addbot <nick> <user> <host> <public chan> <question chan> <staff chan>"); | |
46 | sendnoticetouser(qabot_nick, np, "Add a new bot."); | |
47 | } | |
48 | else if (!ircd_strcmp(arg, "delbot")) { | |
49 | sendnoticetouser(qabot_nick, np, "Syntax: delbot <nick>"); | |
50 | sendnoticetouser(qabot_nick, np, "Delete a bot."); | |
51 | } | |
52 | else if (!ircd_strcmp(arg, "adduser")) { | |
53 | sendnoticetouser(qabot_nick, np, "Syntax: adduser <nick|#authname> <flags>"); | |
54 | sendnoticetouser(qabot_nick, np, "Add a user. Flags may consist of:"); | |
55 | sendnoticetouser(qabot_nick, np, "+a: administrator"); | |
56 | sendnoticetouser(qabot_nick, np, "+d: developer"); | |
57 | sendnoticetouser(qabot_nick, np, "+s: staff"); | |
58 | } | |
59 | else if (!ircd_strcmp(arg, "deluser")) { | |
60 | sendnoticetouser(qabot_nick, np, "Syntax: deluser <nick|#authname>"); | |
61 | sendnoticetouser(qabot_nick, np, "Delete a user."); | |
62 | } | |
63 | else if (!ircd_strcmp(arg, "changelev")) { | |
64 | sendnoticetouser(qabot_nick, np, "Syntax: changelev <nick|#authname> <flags>"); | |
65 | sendnoticetouser(qabot_nick, np, "Change a user's level. Flags may consist of:"); | |
66 | sendnoticetouser(qabot_nick, np, "+a: administrator"); | |
67 | sendnoticetouser(qabot_nick, np, "+d: developer"); | |
68 | sendnoticetouser(qabot_nick, np, "+s: staff"); | |
69 | } | |
70 | else if (!ircd_strcmp(arg, "whois")) { | |
71 | sendnoticetouser(qabot_nick, np, "Syntax: whois <nick|#authname>"); | |
72 | sendnoticetouser(qabot_nick, np, "Display information about a particular user."); | |
73 | } | |
74 | else if (!ircd_strcmp(arg, "status")) { | |
75 | sendnoticetouser(qabot_nick, np, "Syntax: status"); | |
76 | sendnoticetouser(qabot_nick, np, "Display some status information."); | |
77 | } | |
78 | else { | |
79 | sendnoticetouser(qabot_nick, np, "No such command."); | |
80 | return CMD_ERROR; | |
81 | } | |
82 | ||
83 | return CMD_OK; | |
84 | } |