gramio 0.0.25 → 0.0.26

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/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # GramIO
2
2
 
3
- Work in progress
3
+ Work in progress.
4
4
 
5
- Currently support Bot API 7.1
5
+ Currently support Bot API 7.2
6
6
 
7
7
  See [Documentation](https://gramio.netlify.app/)
package/dist/bot.js CHANGED
@@ -397,7 +397,7 @@ let Bot = (() => {
397
397
  });
398
398
  }
399
399
  hears(trigger, handler) {
400
- return this.on("message", (context, next) => {
400
+ return this.on(["message", "business_message"], (context, next) => {
401
401
  if ((typeof trigger === "string" && context.text === trigger) ||
402
402
  // @ts-expect-error
403
403
  (typeof trigger === "function" && trigger(context)) ||
@@ -417,7 +417,7 @@ let Bot = (() => {
417
417
  command(command, handler, options) {
418
418
  if (command.startsWith("/"))
419
419
  throw new Error("Do not use / in command name");
420
- return this.on("message", (context, next) => {
420
+ return this.on(["message", "business_message"], (context, next) => {
421
421
  // TODO: change to find
422
422
  if (context.entities?.some((entity) => {
423
423
  if (entity.type !== "bot_command" || entity.offset > 0)
package/dist/updates.js CHANGED
@@ -37,20 +37,20 @@ class Updates {
37
37
  let context = new UpdateContext({
38
38
  bot: this.bot,
39
39
  update: data,
40
- //@ts-expect-error
41
40
  payload: data[updateType],
42
41
  type: updateType,
43
42
  updateId: data.update_id,
44
43
  });
45
44
  if ("isEvent" in context && context.isEvent() && context.eventType) {
45
+ // @ts-expect-error contextsMappings is any
46
46
  context = new contexts_1.contextsMappings[context.eventType]({
47
47
  bot: this.bot,
48
48
  update: data,
49
- //@ts-expect-error
50
49
  payload: data.message ??
51
50
  data.edited_message ??
52
51
  data.channel_post ??
53
- data.edited_channel_post,
52
+ data.edited_channel_post ??
53
+ data.business_message,
54
54
  type: context.eventType,
55
55
  updateId: data.update_id,
56
56
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gramio",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "Powerful Telegram Bot API framework",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -24,20 +24,20 @@
24
24
  "author": "kravets",
25
25
  "license": "ISC",
26
26
  "devDependencies": {
27
- "@biomejs/biome": "1.6.2",
28
- "@gramio/types": "^7.1.7",
29
- "@types/node": "^20.11.30",
27
+ "@biomejs/biome": "1.6.4",
28
+ "@types/node": "^20.12.4",
30
29
  "typescript": "^5.4.3"
31
30
  },
32
31
  "dependencies": {
33
32
  "@gramio/callback-data": "^0.0.2",
34
- "@gramio/contexts": "^0.0.7",
35
- "@gramio/files": "^0.0.3",
33
+ "@gramio/contexts": "^0.0.8",
34
+ "@gramio/files": "^0.0.4",
36
35
  "@gramio/format": "^0.0.8",
37
- "@gramio/keyboards": "^0.2.2",
36
+ "@gramio/keyboards": "^0.2.3",
37
+ "@gramio/types": "^7.2.1",
38
38
  "inspectable": "^3.0.0",
39
39
  "middleware-io": "^2.8.1",
40
- "undici": "^6.10.1"
40
+ "undici": "^6.11.1"
41
41
  },
42
42
  "files": [
43
43
  "dist"