@grammy-x/conversations 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grammy-x/conversations",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -9,7 +9,7 @@
9
9
  "access": "restricted"
10
10
  },
11
11
  "dependencies": {
12
- "@grammy-x/core": "0.1.0"
12
+ "@grammy-x/core": "0.1.3"
13
13
  },
14
14
  "peerDependencies": {
15
15
  "grammy": "^1.24.0",
@@ -439,7 +439,11 @@ export class QuestionHelper<
439
439
  const answer = await this.conversation.waitFor(":photo")
440
440
  this.updateCtx(answer)
441
441
  await (answer?.msg as any)?.delete?.().catch?.(() => {})
442
- return answer.msg.photo[0].file_id
442
+ const photo = answer.msg.photo?.[0]
443
+ if (!photo) {
444
+ throw new Error("No photo found in update")
445
+ }
446
+ return photo.file_id
443
447
  }
444
448
 
445
449
  file = async (text: string, options?: QuestionParameters) => {