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

Method isAdContent

search/search.ts:674–679  ·  view source on GitHub ↗
(message: Api.Message)

Source from the content-addressed store, hash-verified

672 }
673
674 private isAdContent(message: Api.Message): boolean {
675 const text = (message.text || message.message || "").toLowerCase();
676 const fileNameAttr = message.video?.attributes.find((attr: any): attr is Api.DocumentAttributeFilename => attr instanceof Api.DocumentAttributeFilename);
677 const fileName = (fileNameAttr?.fileName || "").toLowerCase();
678 return this.config.adFilters.some(filter => text.includes(filter) || fileName.includes(filter));
679 }
680
681 private selectRandomVideo(videos: Api.Message[]): Api.Message {
682 return videos[Math.floor(Math.random() * videos.length)];

Callers 2

findAndSendVideoMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected