Initial Commit
This commit is contained in:
commit
b2151a373c
4 changed files with 176 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.env
|
59
main.py
Normal file
59
main.py
Normal file
|
@ -0,0 +1,59 @@
|
|||
import os
|
||||
from slack_bolt import App
|
||||
from slack_bolt.adapter.socket_mode import SocketModeHandler
|
||||
from dotenv import load_dotenv
|
||||
import firepup650 as fp
|
||||
|
||||
input = fp.replitInput
|
||||
|
||||
fp.replitCursor = fp.bcolors.REPLIT + ">>>" + fp.bcolors.RESET
|
||||
|
||||
load_dotenv()
|
||||
|
||||
print(dir(fp))
|
||||
|
||||
# Initializes your app with your bot token and socket mode handler
|
||||
app = App(token=os.environ.get("SLACK_BOT_TOKEN"))
|
||||
client = app.client
|
||||
|
||||
# Start your app
|
||||
if __name__ == "__main__":
|
||||
while 1:
|
||||
chan = input("Channel")
|
||||
try:
|
||||
print("^C to change channel")
|
||||
while 1:
|
||||
thread = input("Reply to a thread?").lower().startswith("y")
|
||||
ts = None
|
||||
if thread:
|
||||
hasID = input("Do you have the TS ID?").lower().startswith("y")
|
||||
if not hasID:
|
||||
try:
|
||||
res = client.conversations_history(
|
||||
channel=chan, inclusive=True, limit=1
|
||||
)
|
||||
found = res["messages"][0]
|
||||
print(found)
|
||||
ts = found["ts"]
|
||||
except Exception as E:
|
||||
print(f"Exception: {E}")
|
||||
else:
|
||||
ts = input("TS ID")
|
||||
print("^C to change thread/channel")
|
||||
while 1:
|
||||
msg = input("Message")
|
||||
try:
|
||||
print(
|
||||
client.chat_postMessage(
|
||||
channel=chan, text=msg, thread_ts=ts
|
||||
)
|
||||
)
|
||||
except Exception as E:
|
||||
print(f"Exception: {E}")
|
||||
msg = input("Message")
|
||||
try:
|
||||
print(client.chat_postMessage(channel=chan, text=msg))
|
||||
except Exception as E:
|
||||
print(f"Exception: {E}")
|
||||
except KeyboardInterrupt:
|
||||
print()
|
98
poetry.lock
generated
Normal file
98
poetry.lock
generated
Normal file
|
@ -0,0 +1,98 @@
|
|||
# This file is automatically @generated by Poetry and should not be changed by hand.
|
||||
|
||||
[[package]]
|
||||
name = "firepup650"
|
||||
version = "1.0.35"
|
||||
description = "Package containing various shorthand things I use, and a few imports I almost always use"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8,<4.0"
|
||||
files = [
|
||||
{file = "firepup650-1.0.35-py3-none-any.whl", hash = "sha256:fb6d326e11ddbc4bb83ffe95b1ec0f2e6937cd7722cdbadd2f3ac31e84bfe3a5"},
|
||||
{file = "firepup650-1.0.35.tar.gz", hash = "sha256:f128b624b8cee762366ccedf8a75b6e89745d08dd919a2df8433f2cbc090da13"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
fkeycapture = ">=1.2.7,<2.0.0"
|
||||
fpsql = ">=1,<1.0.26 || >1.0.26,<2"
|
||||
|
||||
[[package]]
|
||||
name = "fkeycapture"
|
||||
version = "1.2.7"
|
||||
description = "A way to capture keystrokes"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8,<4.0"
|
||||
files = [
|
||||
{file = "fkeycapture-1.2.7-py3-none-any.whl", hash = "sha256:c09cb715ccf2b9dfc25ecd39bffaf8fa794bc07410f666ac2ec15ebebebaabef"},
|
||||
{file = "fkeycapture-1.2.7.tar.gz", hash = "sha256:5ef9c90aec0420a2e462420a2bc8076a50ffd8566a9a022ac171c0e508f1d58d"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fpsql"
|
||||
version = "1.0.5"
|
||||
description = "An easy to use SQLite package"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8,<4.0"
|
||||
files = [
|
||||
{file = "fpsql-1.0.5-py3-none-any.whl", hash = "sha256:a31f4bf99d44c0095a8246bfd78bd39cf96d9b3591363a3f6538ca40914679a4"},
|
||||
{file = "fpsql-1.0.5.tar.gz", hash = "sha256:647d148c5a17bca3a147a3bb281cc12dfc36f6f3f3652f22a1b2a1a3b7367c93"},
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "python-dotenv"
|
||||
version = "1.0.1"
|
||||
description = "Read key-value pairs from a .env file and set them as environment variables"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.8"
|
||||
files = [
|
||||
{file = "python-dotenv-1.0.1.tar.gz", hash = "sha256:e324ee90a023d808f1959c46bcbc04446a10ced277783dc6ee09987c37ec10ca"},
|
||||
{file = "python_dotenv-1.0.1-py3-none-any.whl", hash = "sha256:f7b63ef50f1b690dddf550d03497b66d609393b40b564ed0d674909a68ebf16a"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
cli = ["click (>=5.0)"]
|
||||
|
||||
[[package]]
|
||||
name = "slack-bolt"
|
||||
version = "1.18.1"
|
||||
description = "The Bolt Framework for Python"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
files = [
|
||||
{file = "slack_bolt-1.18.1-py2.py3-none-any.whl", hash = "sha256:2509e5bb43898a593667bf37965057a9b9a41008b29628e3b57a6136b650b90e"},
|
||||
{file = "slack_bolt-1.18.1.tar.gz", hash = "sha256:694f84a81ba1c4c428ba7daa01d599d3e9fba7a54ad10c11008aa22573b23ff0"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
slack-sdk = ">=3.25.0,<4"
|
||||
|
||||
[package.extras]
|
||||
adapter = ["CherryPy (>=18,<19)", "Django (>=3,<5)", "Flask (>=1,<3)", "Werkzeug (>=2,<3)", "boto3 (<=2)", "bottle (>=0.12,<1)", "chalice (>=1.28,<2)", "falcon (>=2,<4)", "fastapi (>=0.70.0,<1)", "gunicorn (>=20,<21)", "pyramid (>=1,<3)", "sanic (>=22,<23)", "starlette (>=0.14,<1)", "tornado (>=6,<7)", "uvicorn (<1)", "websocket-client (>=1.2.3,<2)"]
|
||||
adapter-testing = ["Flask (>=1,<2)", "Werkzeug (>=1,<2)", "boddle (>=0.2,<0.3)", "docker (>=5,<6)", "moto (>=3,<4)", "requests (>=2,<3)", "sanic-testing (>=0.7)"]
|
||||
async = ["aiohttp (>=3,<4)", "websockets (>=10,<11)"]
|
||||
testing = ["Flask-Sockets (>=0.2,<1)", "Jinja2 (==3.0.3)", "Werkzeug (>=1,<2)", "aiohttp (>=3,<4)", "black (==22.8.0)", "click (<=8.0.4)", "itsdangerous (==2.0.1)", "pytest (>=6.2.5,<7)", "pytest-asyncio (>=0.18.2,<1)", "pytest-cov (>=3,<4)"]
|
||||
testing-without-asyncio = ["Flask-Sockets (>=0.2,<1)", "Jinja2 (==3.0.3)", "Werkzeug (>=1,<2)", "black (==22.8.0)", "click (<=8.0.4)", "itsdangerous (==2.0.1)", "pytest (>=6.2.5,<7)", "pytest-cov (>=3,<4)"]
|
||||
|
||||
[[package]]
|
||||
name = "slack-sdk"
|
||||
version = "3.27.2"
|
||||
description = "The Slack API Platform SDK for Python"
|
||||
category = "main"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
files = [
|
||||
{file = "slack_sdk-3.27.2-py2.py3-none-any.whl", hash = "sha256:af97158e6ac7f667e158e8036e63dc1f79db9bd36216a33c10fcc49be7c2f30c"},
|
||||
{file = "slack_sdk-3.27.2.tar.gz", hash = "sha256:bb145bf2bd93b60a17cd55c05cb15868c9a07d845b6fb608c798b50bce21cb99"},
|
||||
]
|
||||
|
||||
[package.extras]
|
||||
optional = ["SQLAlchemy (>=1.4,<3)", "aiodns (>1.0)", "aiohttp (>=3.7.3,<4)", "boto3 (<=2)", "websocket-client (>=1,<2)", "websockets (>=9.1,<13)"]
|
||||
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.11"
|
||||
content-hash = "738ab4e7794862a3d90b916730c5879fd25f901a5d0c4f1056ed62043b293049"
|
18
pyproject.toml
Normal file
18
pyproject.toml
Normal file
|
@ -0,0 +1,18 @@
|
|||
[tool.poetry]
|
||||
name = "fake-app"
|
||||
version = "0"
|
||||
description = "Fake Slack app"
|
||||
authors = ["Firepup Sixfifty <firepyp650@gmail.com>"]
|
||||
readme = "README.md"
|
||||
packages = [{include = "fake_app"}]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.11"
|
||||
slack-bolt = "^1.18.1"
|
||||
python-dotenv = "^1.0.1"
|
||||
firepup650 = "^1.0.35"
|
||||
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
Loading…
Reference in a new issue