(method: string, body: unknown)
| 21 | constructor(private token: string) {} |
| 22 | |
| 23 | private async api(method: string, body: unknown): Promise<any> { |
| 24 | const res = await fetch(`https://api.telegram.org/bot${this.token}/${method}`, { |
| 25 | method: 'POST', |
| 26 | headers: { 'content-type': 'application/json' }, |
| 27 | body: JSON.stringify(body), |
| 28 | }); |
| 29 | return res.json(); |
| 30 | } |
| 31 | |
| 32 | private keyboard(buttons?: Button[][]) { |
| 33 | if (!buttons) return {}; |
no outgoing calls
no test coverage detected