Skip to content
This repository has been archived by the owner on Jul 10, 2022. It is now read-only.

Commit

Permalink
Fix outgoing github
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe committed Mar 26, 2019
1 parent 3645321 commit c90882f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions stdplugins/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import requests


@borg.on(events.NewMessage(pattern=r"\.github (.*)"))
@borg.on(events.MessageEdited(pattern=r"\.github (.*)"))
@borg.on(events.NewMessage(pattern=r"\.github (.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
Expand All @@ -23,12 +22,20 @@ async def _(event):
location = b["location"]
bio = b["bio"]
created_at = b["created_at"]
await event.edit("""[\u2063]({})Name: [{}]({})
await borg.send_file(
event.chat_id,
caption="""Name: [{}]({})
Type: {}
Company: {}
Blog: {}
Location: {}
Bio: {}
Profile Created: {}""".format(avatar_url, name, html_url, gh_type, company, blog, location, bio, created_at))
Profile Created: {}""".format(name, html_url, gh_type, company, blog, location, bio, created_at),
file=avatar_url,
force_document=False,
allow_cache=False,
reply_to=event
)
await event.delete()
else:
await event.edit("`{}`: {}".format(input_str, r.text))

0 comments on commit c90882f

Please sign in to comment.