Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add forwarding of incs2 channel messages to ds webhook #12

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading