29 lines
513 B
Python
Executable File
29 lines
513 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
|
|
import sys
|
|
import yobot.repl
|
|
import yobot.bot
|
|
from yobot.yobot import Yobot
|
|
|
|
import asyncio
|
|
|
|
|
|
def main() -> None:
|
|
if len(sys.argv) < 2:
|
|
print("usage: $0 repl|bot")
|
|
sys.exit(1)
|
|
bot = Yobot()
|
|
match sys.argv[1]:
|
|
case "repl":
|
|
asyncio.run(yobot.repl.main(bot))
|
|
case "bot":
|
|
asyncio.run(yobot.bot.main(bot))
|
|
case _:
|
|
print("usage: $0 repl|bot")
|
|
sys.exit(1)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|