aboutsummaryrefslogtreecommitdiffstats
path: root/jeeves/helpstrings.py
blob: 2a7e2627887e8310a1e786748013ef890d68bbe4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
"""
Jeeves help string constants. Not loaded directly by Sopel.
Imported via sys.path insertion by help.py.
"""

_ADMIN = {
    "join":     "!join #channel - join a channel (owner)",
    "part":     "!part [#channel] - leave a channel, defaults to current (owner)",
    "chans":    "!chans - list channels the bot is currently in (owner)",
    "follow":   "!follow <on/off> - follow owner into channels every 30s (owner)",
    "unfollow": "!unfollow - leave all follow-joined channels immediately (owner)",
    "pause":    "!pause - pause keyword responses (owner)",
    "resume":   "!resume - resume keyword responses (owner)",
}

_DJ = {
    "dj":     "!dj <url> - queue a YouTube URL (shorts, embeds, live not accepted)",
    "np":     "!np - show currently playing track",
    "queue":  "!queue - list up to 4 upcoming tracks",
    "loop":   "!loop - show loop state; !loop <on/off> to change (op)",
    "play":   "!play - start or resume playback (op)",
    "stop":   "!stop - pause playback (op)",
    "skip":   "!skip - skip to next track (op)",
    "remove": "!remove - remove current track from queue (op)",
    "clear":  "!clear - clear queue and stop playback (op)",
}

_DUCK = {
    "bang":   "!bang - fire at the current duck",
    "reload": "!reload - refill ammo, 3s cooldown",
    "score":  "!score - top 5 for this channel; !score clear to reset (op/owner)",
    "hunt":   "!hunt - show hunt state; !hunt start|stop (op); !hunt idle <n> - set idle rounds (0=off) (op); timing via !set duck_spawn_min/max/flee_time",
}

_RECIPES = {
    "breakfast": "!breakfast [list] - random breakfast suggestion or list all",
    "lunch":     "!lunch [list] - random lunch suggestion or list all",
    "dinner":    "!dinner [list] - random dinner suggestion or list all",
    "snack":     "!snack [list] - random snack suggestion or list all",
    "recipe":    "!recipe <name> - full recipe: name, ingredients, steps",
}

_NEWS = {
    "weather":   "!weather <city> - current weather conditions",
    "forecast":  "!forecast <city> - 3-day weather forecast",
    "headlines": "!headlines [global/mena/egypt] [count] - latest headlines",
    "news":      "!news - show broadcast state; !news on/off to toggle (op)",
}

_QUOTES = {
    "quote":  "!quote - random quote; !quote add <text> (op); !quote del <N> (op); !quote list",
    "quotes": "!quotes - show auto-post state; !quotes on/off to toggle (op)",
}

_ART = {
    "draw": "!draw [<lines>] <url> - render image as mIRC colour art (lines 4-12, default from !set art_height)",
}

_CONFIG = {
    "set":    "!set <key> <value> - set a config value (in channel: per-channel; in PM: global, owner only)",
    "config": "!config [#channel] - show all config values for a channel",
}

TOPIC_MAP = {
    "admin":   ("admin: join, part, chans, follow, unfollow, pause, resume. type !help <cmd> for usage", _ADMIN),
    "dj":      ("dj: dj, np, queue, loop, play, stop, skip, remove, clear. type !help <cmd> for usage", _DJ),
    "duck":    ("duck: bang, reload, score, hunt. type !help <cmd> for usage", _DUCK),
    "recipes": ("recipes: breakfast, lunch, dinner, snack, recipe. type !help <cmd> for usage", _RECIPES),
    "news":    ("news: weather, forecast, headlines, news. type !help <cmd> for usage", _NEWS),
    "quotes":  ("quotes: quote, quotes. type !help <cmd> for usage", _QUOTES),
    "art":     ("art: draw. type !help <cmd> for usage", _ART),
    "config":  ("config: set, config. type !help <cmd> for usage", _CONFIG),
}

TOPICS = (
    "topics (commands): "
    "admin (join, part, chans, follow, unfollow, pause, resume), "
    "dj (dj, np, queue, loop, play, stop, skip, remove, clear), "
    "duck (bang, reload, score, hunt), "
    "recipes (breakfast, lunch, dinner, snack, recipe), "
    "news (weather, forecast, headlines, news), "
    "quotes (quote, quotes), "
    "art (draw), "
    "config (set, config). "
    "type !help <topic> or !help <cmd> to know more"
)

_ALL = {**_ADMIN, **_DJ, **_DUCK, **_RECIPES, **_NEWS, **_QUOTES, **_ART, **_CONFIG}


def lookup(args):
    if not args:
        return TOPICS
    first = args[0].lower()
    if first in TOPIC_MAP:
        if len(args) == 1:
            return TOPIC_MAP[first][0]
        cmd = args[1].lower()
        return TOPIC_MAP[first][1].get(cmd)
    return _ALL.get(first)