pyslackers/sirbot-pyslackers

Github links (`g#*`) only expand the first in a single message

Closed this issue ยท 6 comments

I'd expect a message with multiple g#* messages to expand multiple times, currently it only does the first found occurrence.

async def github_repo_link(message, app):
if "text" in message and message["text"]:
response = message.response()
start = message["text"].find("g#") + 2
repo = message["text"][start:].split()[0]
if "/" not in repo:
repo = "pyslackers/" + repo
url = f"https://github.com/{repo}"
r = await app["http_session"].request("GET", url)
if r.status == 200:
response["text"] = url
await app["plugins"]["slack"].api.query(
url=methods.CHAT_POST_MESSAGE, data=response
)

I'd like to pick this up, if possible ๐Ÿ™‚?

ovv commented

Hello @stuartmccoll . You can pick that up.
Feel free to ping me (here or on slack) if you have any question

Thanks, I'm still working on it - finally managed to get Ngrok to successfully tunnel to my Docker container. I've noticed a few things that are missing from the documentation in order to get 'up and running', I'll probably raise a separate pull request for those ๐Ÿ‘.

Update for @ovv to say I have a branch ready to push for PR ๐Ÿ™‚, just need permissions to push.

ovv commented

I've noticed a few things that are missing from the documentation in order to get 'up and running', I'll probably raise a separate pull request for those +1.

That would be fantastic

just need permissions to push

You don't need any permission to push. On github people work via fork and you have all needed permissions on your fork. If you are not familiar with the github flow (this looks like a good introduction https://gist.github.com/Chaser324/ce0505fbed06b947d962).

Thanks, I'll raise the PR this evening ๐Ÿ˜.