From c90882faf561d8d06c6af3bb9b552e50763a573d Mon Sep 17 00:00:00 2001 From: Shrimadhav U K Date: Tue, 26 Mar 2019 14:44:39 +0000 Subject: [PATCH] Fix outgoing github --- stdplugins/github.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/stdplugins/github.py b/stdplugins/github.py index 97246da855..3ee7821490 100644 --- a/stdplugins/github.py +++ b/stdplugins/github.py @@ -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 @@ -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))