()
| 563 | } |
| 564 | |
| 565 | async function getVersion() { |
| 566 | const timeoutMs = 10000; |
| 567 | const opt = { |
| 568 | url: "https://github.wowyijiu.today/https://raw.githubusercontent.com/WowYiJiu/Personal/main/Script/tenvideo.js", |
| 569 | timeout: timeoutMs |
| 570 | }; |
| 571 | let data = await $.fetch(opt).then(response => { |
| 572 | try { |
| 573 | if (response) { |
| 574 | return response |
| 575 | }else { |
| 576 | return "undefined" |
| 577 | } |
| 578 | } catch (e) { |
| 579 | $.logErr(e, response) |
| 580 | } |
| 581 | }) |
| 582 | data = $.toStr(data) |
| 583 | const versionInfo = data.match(/@version\s+(v\d+\.\d+\.\d+)/); |
| 584 | if (versionInfo) { |
| 585 | latestVersion = versionInfo[1]; |
| 586 | } else { |
| 587 | latestVersion = "undefined"; |
| 588 | } |
| 589 | return latestVersion; |
| 590 | } |
| 591 | |
| 592 | async function SendMsg() { |
| 593 | $.msg($.name, "", `${$.version}\n${$.taskInfo}`); |
no test coverage detected