webexmemebot/app/main.py

34 lines
683 B
Python
Raw Normal View History

2023-07-21 22:57:14 +01:00
#!/usr/local/bin/python3
import os
from webex_bot.webex_bot import WebexBot
2023-12-14 20:55:17 +00:00
from app import close, meme
2023-07-21 22:57:14 +01:00
WBX_API_KEY: str = os.environ["WEBEX_API_KEY"]
def create_bot() -> WebexBot:
"""Create a Bot object."""
bot = WebexBot(
teams_bot_token=WBX_API_KEY,
approved_domains=["cisco.com"],
bot_name="MemeBot",
include_demo_commands=False,
)
return bot
2023-07-24 16:16:30 +01:00
def main() -> None:
2023-07-21 22:57:14 +01:00
bot: WebexBot = create_bot()
bot.add_command(meme.MakeMemeCommand())
2023-07-24 16:16:30 +01:00
bot.add_command(close.ExitCommand())
2023-07-21 22:57:14 +01:00
bot.commands.remove(bot.help_command)
bot.help_command = meme.MakeMemeCommand()
bot.run()
if __name__ == "__main__":
main()