diff options
Diffstat (limited to 'src/main.py')
| -rw-r--r-- | src/main.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/main.py b/src/main.py new file mode 100644 index 0000000..f16c198 --- /dev/null +++ b/src/main.py @@ -0,0 +1,39 @@ +import os +from slack_bolt import App +from slack_bolt.adapter.socket_mode import SocketModeHandler +from dotenv import load_dotenv + +load_dotenv() + +app = App(token=os.environ.get("SLACK_SELFBOT_OAUTH_XOXP")) + +def handle_messages(message, say): + if message.get("channel_type") != "im": + return + + if message.get("user") == 'U0BFUFPFDGE': + return + + text = message.get("text", "").lower().strip() + + if not text.startswith("botnet"): + return + + parts = text.split(" ") + if len(parts) == 1: + say("Usage:\n`botnet help`") + return + + command = parts[1] + args = parts[2:] + + say(f"Command: {command}, Args: {args}") + [email protected]("message") +def shut_up_slack_bolt(): + pass + +if __name__ == "__main__": + handler = SocketModeHandler(app, app_token=os.environ.get("SLACK_APP_TOKEN")) + handler.start() |
