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

Method handleAutoDel

autodel/autodel.ts:101–135  ·  view source on GitHub ↗
(msg: Api.Message)

Source from the content-addressed store, hash-verified

99 }
100
101 private async handleAutoDel(msg: Api.Message): Promise<void> {
102 const args = msg.message.split(" ").slice(1);
103
104 if (args.length === 0 || args[0] === "h") {
105 await msg.edit({
106 text: this.getHelpText(),
107 parseMode: "html"
108 });
109 return;
110 }
111
112 if (args[0] === "l") {
113 await this.showAutoDelSettings(msg);
114 return;
115 }
116
117 if (args[0] === "cancel") {
118 await this.cancelAutoDelSetting(msg, args.includes("global"));
119 return;
120 }
121
122 const timeStr = args[0];
123 const isGlobal = args.includes("global");
124
125 const delaySeconds = this.parseTimeString(timeStr);
126 if (delaySeconds === null) {
127 await msg.edit({
128 text: "❌ 时间格式错误,请使用如:30 seconds, 5 minutes, 2 hours, 1 days"
129 });
130 return;
131 }
132
133 // 设置自动删除配置
134 await this.setAutoDelSetting(msg, delaySeconds, isGlobal);
135 }
136
137 private getHelpText(): string {
138 return `📝 <b>定时删除消息帮助</b>\n\n` +

Callers

nothing calls this directly

Calls 6

getHelpTextMethod · 0.95
showAutoDelSettingsMethod · 0.95
cancelAutoDelSettingMethod · 0.95
parseTimeStringMethod · 0.95
setAutoDelSettingMethod · 0.95
editMethod · 0.45

Tested by

no test coverage detected