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

Function deleteMessageOrGroup

ai/ai.ts:846–858  ·  view source on GitHub ↗
(msg: Api.Message)

Source from the content-addressed store, hash-verified

844
845const deleteMessageOrGroup = async (msg: Api.Message): Promise<void> => {
846 try {
847 if (!msg?.client) return;
848 const peer = msg.chatId || msg.peerId;
849 const ids = await getGroupedMessageIds(msg);
850
851 if (ids.length > 1) {
852 await msg.client.deleteMessages(peer, ids, { revoke: true });
853 return;
854 }
855 await msg.delete();
856 } catch {}
857};
858
859const getHeaderContentType = (headers: unknown): string | undefined => {
860 if (!headers || typeof headers !== "object") return undefined;
861 const contentType = (headers as Record<string, unknown>)["content-type"];

Callers 4

handleQuestionMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85

Calls 2

getGroupedMessageIdsFunction · 0.85
deleteMethod · 0.45

Tested by

no test coverage detected