matrix-gptbot/src/gptbot/commands/__init__.py
Kumi 55809a9a39
Make it an importable module
Abandon DuckDB in favor of sqlite3
2023-05-25 07:28:28 +00:00

30 lines
535 B
Python

from importlib import import_module
from .unknown import command_unknown
COMMANDS = {}
for command in [
"help",
"newroom",
"stats",
"botinfo",
"coin",
"ignoreolder",
"systemmessage",
"imagine",
"calculate",
"classify",
"chat",
"custom",
"privacy",
"roomsettings",
"dice",
"parcel",
"space",
]:
function = getattr(import_module(
"." + command, "gptbot.commands"), "command_" + command)
COMMANDS[command] = function
COMMANDS[None] = command_unknown