@codebam/cf-workers-telegram-bot 11.8.1 → 11.10.0

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.
@@ -219,4 +219,10 @@ export default class TelegramApi {
219
219
  * @returns Promise with the API response
220
220
  */
221
221
  answerPreCheckoutQuery(botApi: string, data: AnswerPreCheckoutParams): Promise<Response>;
222
+ /**
223
+ * Get basic information about the bot
224
+ * @param botApi - full URL to the telegram API without slug
225
+ * @returns Promise with the API response
226
+ */
227
+ getMe(botApi: string): Promise<Response>;
222
228
  }
@@ -206,4 +206,13 @@ export default class TelegramApi {
206
206
  const url = this.getApiUrl(botApi, 'answerPreCheckoutQuery', data);
207
207
  return await this.fetchAndLog(url, 'answerPreCheckoutQuery', data);
208
208
  }
209
+ /**
210
+ * Get basic information about the bot
211
+ * @param botApi - full URL to the telegram API without slug
212
+ * @returns Promise with the API response
213
+ */
214
+ async getMe(botApi) {
215
+ const url = this.getApiUrl(botApi, 'getMe', {});
216
+ return await this.fetchAndLog(url, 'getMe', {});
217
+ }
209
218
  }
@@ -56,7 +56,7 @@ export default class TelegramExecutionContext {
56
56
  case 'message':
57
57
  case 'business_message':
58
58
  case 'guest_message':
59
- return (this.update.message?.text ?? this.update.guest_message?.text)?.split(' ') ?? [];
59
+ return (this.update.message?.text ?? this.update.business_message?.text ?? this.update.guest_message?.text)?.toString().split(' ') ?? [];
60
60
  case 'inline':
61
61
  return this.update.inline_query?.query.split(' ') ?? [];
62
62
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebam/cf-workers-telegram-bot",
3
- "version": "11.8.1",
3
+ "version": "11.10.0",
4
4
  "description": "serverless telegram bot on cf workers",
5
5
  "main": "./dist/main.js",
6
6
  "module": "./dist/main.js",