Control socket: show emotes
このコミットが含まれているのは:
コミット
ed8ba4aacc
|
@ -16,12 +16,21 @@ EMOTES = current_app.emotes
|
||||||
async def cmd_emote_help():
|
async def cmd_emote_help():
|
||||||
normal = ['emote', 'help']
|
normal = ['emote', 'help']
|
||||||
response = (
|
response = (
|
||||||
'Usage: emote reload\n'
|
'Usage: emote [show | reload]\n'
|
||||||
'Commands:\n'
|
'Commands:\n'
|
||||||
|
' emote show........show all current emotes\n'
|
||||||
' emote reload......try to reload the emote schema (existing messages are not modified)\n'
|
' emote reload......try to reload the emote schema (existing messages are not modified)\n'
|
||||||
)
|
)
|
||||||
return normal, response
|
return normal, response
|
||||||
|
|
||||||
|
async def cmd_emote_show():
|
||||||
|
emotes_for_json = [emote.copy() for emote in EMOTES]
|
||||||
|
for emote in emotes_for_json:
|
||||||
|
emote['regex'] = emote['regex'].pattern
|
||||||
|
normal = ['emote', 'show']
|
||||||
|
response = json.dumps(emotes_for_json) + '\n'
|
||||||
|
return normal, response
|
||||||
|
|
||||||
async def cmd_emote_reload():
|
async def cmd_emote_reload():
|
||||||
try:
|
try:
|
||||||
emotes = await load_emote_schema_async(CONFIG['EMOTE_SCHEMA'])
|
emotes = await load_emote_schema_async(CONFIG['EMOTE_SCHEMA'])
|
||||||
|
@ -46,6 +55,7 @@ async def cmd_emote_reload():
|
||||||
SPEC = Str({
|
SPEC = Str({
|
||||||
None: End(cmd_emote_help),
|
None: End(cmd_emote_help),
|
||||||
'help': End(cmd_emote_help),
|
'help': End(cmd_emote_help),
|
||||||
|
'show': End(cmd_emote_show),
|
||||||
'reload': End(cmd_emote_reload),
|
'reload': End(cmd_emote_reload),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ async def cmd_help():
|
||||||
' allowedness setdefault BOOLEAN.set the default allowedness\n'
|
' allowedness setdefault BOOLEAN.set the default allowedness\n'
|
||||||
' allowedness add SET STRING.....add to the blacklist/whitelist\n'
|
' allowedness add SET STRING.....add to the blacklist/whitelist\n'
|
||||||
' allowedness remove SET STRING..remove from the blacklist/whitelist\n'
|
' allowedness remove SET STRING..remove from the blacklist/whitelist\n'
|
||||||
|
' emote show.....................show all current emotes\n'
|
||||||
' emote reload...................try reloading the emote schema\n'
|
' emote reload...................try reloading the emote schema\n'
|
||||||
)
|
)
|
||||||
return normal, response
|
return normal, response
|
||||||
|
|
読み込み中…
新しいイシューから参照