(
msg: Api.Message,
args: string[],
_prefixes: string[],
)
| 4201 | |
| 4202 | async execute( |
| 4203 | msg: Api.Message, |
| 4204 | args: string[], |
| 4205 | _prefixes: string[], |
| 4206 | ): Promise<void> { |
| 4207 | const configManager = await this.getConfigManager(); |
| 4208 | const config = configManager.getConfig(); |
| 4209 | |
| 4210 | if (args.length < 2) { |
| 4211 | await this.showTelegraphStatus(msg, config); |
| 4212 | return; |
| 4213 | } |
| 4214 | |
| 4215 | const action = args[1].toLowerCase(); |
| 4216 | if (action === "on") { |
| 4217 | await this.enableTelegraph(msg, configManager); |
| 4218 | return; |
| 4219 | } |
| 4220 | if (action === "off") { |
| 4221 | await this.disableTelegraph(msg, configManager); |
| 4222 | return; |
| 4223 | } |
| 4224 | if (action === "limit") { |
| 4225 | requireUser(args.length >= 3, "参数格式错误"); |
| 4226 | await this.setTelegraphLimit(msg, args, configManager); |
| 4227 | return; |
| 4228 | } |
| 4229 | if (action === "del") { |
| 4230 | requireUser(args.length >= 3, "参数格式错误"); |
| 4231 | await this.deleteTelegraphItem(msg, args, configManager); |
| 4232 | return; |
| 4233 | } |
| 4234 | await this.showTelegraphStatus(msg, config); |
| 4235 | } |
| 4236 | |
| 4237 | private async showTelegraphStatus( |
| 4238 | msg: Api.Message, |
| 4239 | config: DB, |
nothing calls this directly
no test coverage detected