Skip to content

Commit

Permalink
Merge pull request #12 from akimerslys/master
Browse files Browse the repository at this point in the history
Add forwarding of t.me/INCS2 messages to a Discord webhook
  • Loading branch information
SyberiaK authored Apr 4, 2024
2 parents a79a4ba + f918d97 commit 4758f6e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions plugins/incs2chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@ async def echo(client: Client, message: Message): # todo: more attachments?
return await reply_to.reply_video(video, quote=should_reply, caption=caption, caption_entities=entities)


@Client.on_message(filters.text & filters.chat(config.INCS2CHANNEL))
async def echo(client, message):
payload = {"content": message.text}
headers = {"Content-Type": "application/json"}
r = requests.post(config.DS_WEBHOOK_URL, json=payload, headers=headers)
if r.status_code == 200:
pass #place for logger

else:
pass #place for logger


@Client.on_message(filters.linked_channel & filters.chat(config.INCS2CHAT))
async def cs_l10n_update(_, message: Message):
if (message.sender_chat
Expand Down

0 comments on commit 4758f6e

Please sign in to comment.