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

Function deleteCommandMessage

t/t.ts:210–222  ·  view source on GitHub ↗

私聊删除命令:为双方删除;群/频道:仅自己删除

(msg: Api.Message)

Source from the content-addressed store, hash-verified

208 });
209 await fs.writeFile(mp3File, res.data);
210 await execFileAsync("ffmpeg", ["-y", "-i", mp3File, "-c:a", "libopus", "-b:a", "64k", "-vbr", "on", oggFile], { shell: false });
211 return { oggFile, mp3File };
212 } catch {
213 return null;
214 }
215}
216
217/** 私聊删除命令:为双方删除;群/频道:仅自己删除 */
218async function deleteCommandMessage(msg: Api.Message) {
219 try {
220 const isPrivate =
221 (msg as any).isPrivate === true ||
222 (msg.peerId instanceof (Api as any).PeerUser);
223
224 if (isPrivate) {
225 await (msg as any).delete({ revoke: true }); // 双向删除

Callers 1

ttsFunction · 0.70

Calls 1

deleteMethod · 0.45

Tested by

no test coverage detected