@grammy-x/conversations 0.1.1 → 0.1.2
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 +2 -2
- package/src/question-helper.ts +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grammy-x/conversations",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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.
|
|
12
|
+
"@grammy-x/core": "0.1.1"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"grammy": "^1.24.0",
|
package/src/question-helper.ts
CHANGED
|
@@ -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
|
-
|
|
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) => {
|