-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrun.py
More file actions
42 lines (39 loc) · 1.28 KB
/
run.py
File metadata and controls
42 lines (39 loc) · 1.28 KB
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
import argparse
from diy_chatbot.config import settings
from diy_chatbot.interfaces import cli_interface, discord_interface
def main():
parser = argparse.ArgumentParser(description="DIY-Chatbot: Modular Chatbot Application")
parser.add_argument(
"interface",
choices=["cli", "discord"],
help="Choose which interface to run: 'cli' for command-line, 'discord' for Discord bot."
)
parser.add_argument(
"--db-path",
type=str,
default=settings.DATABASE_PATH,
help="Path to the SQLite database file."
)
parser.add_argument(
"--discord-token",
type=str,
default=settings.DISCORD_BOT_TOKEN,
help="Discord bot token (overrides config/env)."
)
parser.add_argument(
"--channel-id",
type=int,
default=settings.CHATBOT_CHANNEL_ID,
help="Discord channel ID for the bot (overrides config/env)."
)
args = parser.parse_args()
if args.interface == "cli":
cli_interface.run_cli(db_path=args.db_path)
elif args.interface == "discord":
discord_interface.run_discord(
db_path=args.db_path,
discord_token=args.discord_token,
chatbot_channel_id=args.channel_id
)
if __name__ == "__main__":
main()