JJ / denotas-bot

Bot para revelar las notas personalmente en Deno
GNU General Public License v3.0
0 stars 0 forks source link

Evitar que pete cuando hay algún error (bloqueo, por ejemplo) #6

Open JJ opened 1 year ago

JJ commented 1 year ago

Por ejemplo, este:

error: Uncaught (in promise) Error: 403
Forbidden: bot was blocked by the user
          throw new Error(`${error_code}\n${description}`);
JJ commented 1 year ago

También hay este error:

error: Uncaught (in promise) Error: 400
Bad Request: can't parse entities: Character '.' is reserved and must be escaped with the preceding '\'
          throw new Error(`${error_code}\n${description}`);
                ^
    at https://deno.land/x/telegram_bot_api@0.4.0/src/telegram-bot/telegram-bot.ts:213:17
    at async file:///home/jmerelo/Asignaturas/infraestructura-virtual/denotas-bot/main.ts:28:3

Aunque este es nuevo, y es cuando se ha añadido parsing con markdown de los mensajes (aunque pensaba que era por cada mensaje)

JJ commented 1 year ago

Error cuando el nombre tiene un subrayado:

error: Uncaught (in promise) Error: 400
Bad Request: can't parse entities: Can't find end of Bold entity at byte offset 106
          throw new Error(`${error_code}\n${description}`);