Merge pull request #879 to make Telegram reply-to-message behavior configurable (default false)
feat: make Telegram reply-to-message behavior configurable, default false
This commit is contained in:
@@ -224,9 +224,9 @@ class TelegramChannel(BaseChannel):
|
|||||||
logger.error("Invalid chat_id: {}", msg.chat_id)
|
logger.error("Invalid chat_id: {}", msg.chat_id)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Build reply parameters (Will reply to the message if it exists)
|
|
||||||
reply_to_message_id = msg.metadata.get("message_id")
|
|
||||||
reply_params = None
|
reply_params = None
|
||||||
|
if self.config.reply_to_message:
|
||||||
|
reply_to_message_id = msg.metadata.get("message_id")
|
||||||
if reply_to_message_id:
|
if reply_to_message_id:
|
||||||
reply_params = ReplyParameters(
|
reply_params = ReplyParameters(
|
||||||
message_id=reply_to_message_id,
|
message_id=reply_to_message_id,
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ class TelegramConfig(Base):
|
|||||||
token: str = "" # Bot token from @BotFather
|
token: str = "" # Bot token from @BotFather
|
||||||
allow_from: list[str] = Field(default_factory=list) # Allowed user IDs or usernames
|
allow_from: list[str] = Field(default_factory=list) # Allowed user IDs or usernames
|
||||||
proxy: str | None = None # HTTP/SOCKS5 proxy URL, e.g. "http://127.0.0.1:7890" or "socks5://127.0.0.1:1080"
|
proxy: str | None = None # HTTP/SOCKS5 proxy URL, e.g. "http://127.0.0.1:7890" or "socks5://127.0.0.1:1080"
|
||||||
|
reply_to_message: bool = False # If true, bot replies quote the original message
|
||||||
|
|
||||||
|
|
||||||
class FeishuConfig(Base):
|
class FeishuConfig(Base):
|
||||||
|
|||||||
Reference in New Issue
Block a user