(game: EpicGame, index: number)
| 107 | const title = htmlEscape(game.title); |
| 108 | const desc = game.description.length > 100 ? htmlEscape(game.description.slice(0, 100)) + "..." : htmlEscape(game.description); |
| 109 | const start = formatDate(game.startDate); |
| 110 | const end = formatDate(game.endDate); |
| 111 | const link = game.url ? `<a href="${htmlEscape(game.url)}">🔗 领取</a>` : ""; |
| 112 | |
| 113 | return `<b>${index}. ${title}</b> |
| 114 | 💰 原价: <code>${htmlEscape(game.originalPrice)}</code> → <b>免费</b> |
| 115 | 📅 ${start} ~ ${end} |
| 116 | ${desc} |
| 117 | ${link}`; |
| 118 | } |
| 119 | |
| 120 | class EpicPlugin extends Plugin { |
| 121 | |
| 122 | description: string = help_text; |
| 123 | |
| 124 | cmdHandlers: Record<string, (msg: Api.Message) => Promise<void>> = { |
no test coverage detected