Skip to content

Instantly share code, notes, and snippets.

View rezazarchi's full-sized avatar

Reza Zarchi rezazarchi

View GitHub Profile
@rezazarchi
rezazarchi / sendTelegramGroupRules.js
Last active March 12, 2025 11:40
Telegram Bot for showing rules to new members in supergroup
/**
* Telegram Bot for showing rules to new members in a Supergroup
* The bot can be hosted on Cloudflare Workers
* This bot automatically sends a welcome message with group rules when a new user joins the supergroup.
* - The welcome message includes an "Accept" button.
* - Only the mentioned user can click the button to accept the rules.
* - When accepted, the bot deletes the welcome message to keep the chat clean.
* - If another user clicks the button, they receive an alert message.
*
* The bot is deployed on Cloudflare Workers and listens for updates via Telegram Webhook.
@rezazarchi
rezazarchi / MessageConverter.kt
Last active October 7, 2023 09:42
Mapping K9 MimeMessage objects to Javax Mail MimeMessage objects together
package com.fsck.k9.message
import android.content.Context
import com.fsck.k9.mail.internet.MimeHeader
import com.fsck.k9.mail.internet.MimeMessageHelper
import com.fsck.k9.mail.internet.MimeMultipart
import com.fsck.k9.mail.internet.TextBody
import com.fsck.k9.mailstore.TempFileBody
import java.io.File