MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / sendAffByIndex

Method sendAffByIndex

aff/aff.ts:187–200  ·  view source on GitHub ↗
(msg: Api.Message, index: number)

Source from the content-addressed store, hash-verified

185 // 用户输入通常是 1-based,所以减 1
186 const realIndex = index - 1;
187
188 if (realIndex >= 0 && realIndex < affs.length) {
189 await this.sendAffContent(msg, affs[realIndex]);
190 } else {
191 await msg.edit({
192 text: `❌ <b>找不到序号为 ${index} 的Aff信息</b>`,
193 parseMode: "html"
194 });
195 }
196 }
197
198 // 发送内容的核心方法
199 private async sendAffContent(msg: Api.Message, aff: AffData): Promise<void> {
200 await msg.edit({
201 text: aff.text,
202 parseMode: "html",
203 linkPreview: !aff.web_page

Callers 1

handleAffCommandMethod · 0.95

Calls 3

getAffsMethod · 0.95
sendAffContentMethod · 0.95
editMethod · 0.45

Tested by

no test coverage detected