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

Function resolveAlias

autodelcmd/autodelcmd.ts:56–66  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

54 const aliasDB = new AliasDB();
55 const originalCommand = aliasDB.get(command);
56 aliasDB.close();
57 return originalCommand || command; // 如果没有别名,返回原始命令
58 } catch (error) {
59 console.error("[autodelcmd] 解析别名时出错:", error);
60 return command; // 出错时返回原始命令
61 }
62}
63
64// 计算现有规则中的最大数字ID
65function getMaxRuleId(rules: CommandRule[]): number {
66 const existingIds = rules
67 .map(r => parseInt(r.id || '0'))
68 .filter(id => !isNaN(id));
69

Callers 1

Calls 3

errorMethod · 0.80
getMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected