Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
AUTH_SECRET=
AUTH_GITHUB_ID=
AUTH_GITHUB_SECRET=
DISABLE_REGISTER=false
DISABLE_REGISTER=false

3 changes: 2 additions & 1 deletion components/template-fields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ function FieldComponent({

// 判断字段是否支持变量插入
function isVariableSupported(field: TemplateField) {
return field.component === 'input' || field.component === 'textarea' || !field.component
// return field.component === 'input' || field.component === 'textarea' || !field.component
return field.component === 'textarea' || !field.component
}

export function TemplateFields({ form, template }: TemplateFieldsProps) {
Expand Down
23 changes: 22 additions & 1 deletion lib/channels/telegram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { BaseChannel, ChannelConfig, SendMessageOptions } from "./base"

interface TelegramMessage {
chat_id: string
message_thread_id?: string
text: string
parse_mode?: "HTML" | "Markdown" | "MarkdownV2"
disable_web_page_preview?: boolean
Expand All @@ -19,7 +20,10 @@ export class TelegramChannel extends BaseChannel {
description: "文本消息,支持 HTML 标签",
fields: [
{ key: "text", description: "HTML内容", required: true, component: 'textarea' },
{ key: "chat_id", description: "Chat ID 覆盖渠道配置", required: false, component: 'input' },
{ key: "message_thread_id", description: "群组话题ID", required: false, component: 'input' },
{ key: "disable_notification", description: "静默发送", component: 'checkbox' },
{ key: "disable_web_page_preview", description: "禁用网页预览", component: 'checkbox' },
{ key: "parse_mode", component: 'hidden', defaultValue: "HTML" },
],
},
Expand All @@ -34,6 +38,23 @@ export class TelegramChannel extends BaseChannel {
required: true,
component: 'textarea'
},
{
key: "chat_id",
description: "Chat ID 覆盖渠道配置",
required: false,
component: 'input'
},
{
key: "message_thread_id",
description: "群组话题ID",
required: false,
component: 'input'
},
{
key: "disable_web_page_preview",
description: "禁用网页预览",
component: 'checkbox'
},
{
key: "disable_notification",
description: "静默发送",
Expand Down Expand Up @@ -70,7 +91,7 @@ export class TelegramChannel extends BaseChannel {
},
body: JSON.stringify({
...message,
chat_id: chatId,
chat_id: message.chat_id ||chatId,
}),
}
)
Expand Down