diff --git a/guide/dispatcher/errors.md b/guide/dispatcher/errors.md index 61543a7..659b0f9 100755 --- a/guide/dispatcher/errors.md +++ b/guide/dispatcher/errors.md @@ -22,7 +22,7 @@ dp.onNewMessage( ) dp.onError(async (error, update, state) => { - if (update.type === 'new_message') { + if (update.name === 'new_message') { await update.data.replyText(`Error: ${error.message}`) return true diff --git a/guide/topics/files.md b/guide/topics/files.md index 05d2ed8..5a1d546 100755 --- a/guide/topics/files.md +++ b/guide/topics/files.md @@ -11,7 +11,7 @@ To download a file, just use `downloadIterable`, `downloadStream`, ```ts tg.on('new_message', async (msg) => { if (msg.media?.type === 'photo') { - await tg.downloadToFile(msg.media) + await tg.downloadToFile('download.jpg', msg.media) } }) ```