Comparing version 0.1.4 to 0.2.0
@@ -90,3 +90,3 @@ import { Composer } from './composer'; | ||
* | ||
* You should to three things to run your bot: | ||
* You should do three things to run your bot: | ||
* ```ts | ||
@@ -93,0 +93,0 @@ * // 1. Create a bot instance |
@@ -33,3 +33,3 @@ "use strict"; | ||
* | ||
* You should to three things to run your bot: | ||
* You should do three things to run your bot: | ||
* ```ts | ||
@@ -74,3 +74,4 @@ * // 1. Create a bot instance | ||
this.errorHandler = async (err) => { | ||
console.error('Error in middleware while handling update', err.ctx.update.update_id, err.error); | ||
var _a, _b; | ||
console.error('Error in middleware while handling update', (_b = (_a = err.ctx) === null || _a === void 0 ? void 0 : _a.update) === null || _b === void 0 ? void 0 : _b.update_id, err.error); | ||
console.error('No error handler was set!'); | ||
@@ -77,0 +78,0 @@ console.error('Set your own error handler with `bot.catch = ...`'); |
@@ -201,3 +201,3 @@ import { Context } from './context'; | ||
*/ | ||
hears(trigger: MaybeArray<string | RegExp>, ...middleware: Array<Middleware<Filter<C, ':text' | ':caption'>>>): Composer<(C & Record<"update", import("@grammyjs/types/update").Update.ChannelPostUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.ChannelPostUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"channel_post", import("@grammyjs/types/message").Message.TextMessage & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/message").Message.TextMessage, "poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "reply_markup" | "channel_chat_created" | "message_id" | "from" | "sender_chat" | "date" | "chat" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "text" | "entities" | "forward_from" | "forward_from_chat" | "forward_from_message_id" | "forward_signature" | "forward_sender_name" | "forward_date" | "reply_to_message" | "via_bot" | "edit_date" | "author_signature" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue">> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.Channel>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.ChannelPostUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.ChannelPostUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"channel_post", import("@grammyjs/types/message").Message.TextMessage & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/message").Message.TextMessage, "poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "reply_markup" | "channel_chat_created" | "message_id" | "from" | "sender_chat" | "date" | "chat" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "text" | "entities" | "forward_from" | "forward_from_chat" | "forward_from_message_id" | "forward_signature" | "forward_sender_name" | "forward_date" | "reply_to_message" | "via_bot" | "edit_date" | "author_signature" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue">> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.Channel>>) | (C & Record<"update", import("@grammyjs/types/update").Update.ChannelPostUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.ChannelPostUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"channel_post", never>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.ChannelPostUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.ChannelPostUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"channel_post", never>>) | (C & Record<"update", import("@grammyjs/types/update").Update.MessageUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.MessageUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"message", import("@grammyjs/types/message").Message.TextMessage & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/message").Message.TextMessage, "poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "reply_markup" | "channel_chat_created" | "message_id" | "from" | "sender_chat" | "date" | "chat" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "text" | "entities" | "forward_from" | "forward_from_chat" | "forward_from_message_id" | "forward_signature" | "forward_sender_name" | "forward_date" | "reply_to_message" | "via_bot" | "edit_date" | "author_signature" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue">> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.NonChannel>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.MessageUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.MessageUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"message", import("@grammyjs/types/message").Message.TextMessage & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/message").Message.TextMessage, "poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "reply_markup" | "channel_chat_created" | "message_id" | "from" | "sender_chat" | "date" | "chat" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "text" | "entities" | "forward_from" | "forward_from_chat" | "forward_from_message_id" | "forward_signature" | "forward_sender_name" | "forward_date" | "reply_to_message" | "via_bot" | "edit_date" | "author_signature" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue">> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.NonChannel>>) | (C & Record<"update", import("@grammyjs/types/update").Update.MessageUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.MessageUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"message", never>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.MessageUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.MessageUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"message", never>>)>; | ||
hears(trigger: MaybeArray<string | RegExp>, ...middleware: Array<Middleware<Filter<C, ':text' | ':caption'>>>): Composer<(C & Record<"update", import("@grammyjs/types/update").Update.ChannelPostUpdate & Partial<Record<"callback_query" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"channel_post", import("@grammyjs/types/message").Message.TextMessage & Partial<Record<"poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "channel_chat_created" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue", undefined>> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.Channel>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.ChannelPostUpdate & Partial<Record<"callback_query" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"channel_post", import("@grammyjs/types/message").Message.TextMessage & Partial<Record<"poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "channel_chat_created" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue", undefined>> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.Channel>>) | (C & Record<"update", import("@grammyjs/types/update").Update.ChannelPostUpdate & Partial<Record<"callback_query" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"channel_post", never>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.ChannelPostUpdate & Partial<Record<"callback_query" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"channel_post", never>>) | (C & Record<"update", import("@grammyjs/types/update").Update.MessageUpdate & Partial<Record<"callback_query" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"message", import("@grammyjs/types/message").Message.TextMessage & Partial<Record<"poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "channel_chat_created" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue", undefined>> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.NonChannel>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.MessageUpdate & Partial<Record<"callback_query" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"message", import("@grammyjs/types/message").Message.TextMessage & Partial<Record<"poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "channel_chat_created" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue", undefined>> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.NonChannel>>) | (C & Record<"update", import("@grammyjs/types/update").Update.MessageUpdate & Partial<Record<"callback_query" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"message", never>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.MessageUpdate & Partial<Record<"callback_query" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"message", never>>)>; | ||
/** | ||
@@ -244,3 +244,3 @@ * Registers some middleware that will only be executed when a certain | ||
*/ | ||
command(command: MaybeArray<string>, ...middleware: Array<Middleware<Filter<C, ':entities:bot_command'>>>): Composer<(C & Record<"update", import("@grammyjs/types/update").Update.ChannelPostUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.ChannelPostUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"channel_post", import("@grammyjs/types/message").Message.TextMessage & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/message").Message.TextMessage, "poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "reply_markup" | "channel_chat_created" | "message_id" | "from" | "sender_chat" | "date" | "chat" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "text" | "entities" | "forward_from" | "forward_from_chat" | "forward_from_message_id" | "forward_signature" | "forward_sender_name" | "forward_date" | "reply_to_message" | "via_bot" | "edit_date" | "author_signature" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue">> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.Channel>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.ChannelPostUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.ChannelPostUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"channel_post", import("@grammyjs/types/message").Message.TextMessage & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/message").Message.TextMessage, "poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "reply_markup" | "channel_chat_created" | "message_id" | "from" | "sender_chat" | "date" | "chat" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "text" | "entities" | "forward_from" | "forward_from_chat" | "forward_from_message_id" | "forward_signature" | "forward_sender_name" | "forward_date" | "reply_to_message" | "via_bot" | "edit_date" | "author_signature" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue">> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.Channel>>) | (C & Record<"update", import("@grammyjs/types/update").Update.MessageUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.MessageUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"message", import("@grammyjs/types/message").Message.TextMessage & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/message").Message.TextMessage, "poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "reply_markup" | "channel_chat_created" | "message_id" | "from" | "sender_chat" | "date" | "chat" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "text" | "entities" | "forward_from" | "forward_from_chat" | "forward_from_message_id" | "forward_signature" | "forward_sender_name" | "forward_date" | "reply_to_message" | "via_bot" | "edit_date" | "author_signature" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue">> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.NonChannel>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.MessageUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.MessageUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"message", import("@grammyjs/types/message").Message.TextMessage & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/message").Message.TextMessage, "poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "reply_markup" | "channel_chat_created" | "message_id" | "from" | "sender_chat" | "date" | "chat" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "text" | "entities" | "forward_from" | "forward_from_chat" | "forward_from_message_id" | "forward_signature" | "forward_sender_name" | "forward_date" | "reply_to_message" | "via_bot" | "edit_date" | "author_signature" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue">> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.NonChannel>>)>; | ||
command(command: MaybeArray<string>, ...middleware: Array<Middleware<Filter<C, ':entities:bot_command'>>>): Composer<(C & Record<"update", import("@grammyjs/types/update").Update.ChannelPostUpdate & Partial<Record<"callback_query" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"channel_post", import("@grammyjs/types/message").Message.TextMessage & Partial<Record<"poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "channel_chat_created" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue", undefined>> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.Channel>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.ChannelPostUpdate & Partial<Record<"callback_query" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"channel_post", import("@grammyjs/types/message").Message.TextMessage & Partial<Record<"poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "channel_chat_created" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue", undefined>> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.Channel>>) | (C & Record<"update", import("@grammyjs/types/update").Update.MessageUpdate & Partial<Record<"callback_query" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"message", import("@grammyjs/types/message").Message.TextMessage & Partial<Record<"poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "channel_chat_created" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue", undefined>> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.NonChannel>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.MessageUpdate & Partial<Record<"callback_query" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"message", import("@grammyjs/types/message").Message.TextMessage & Partial<Record<"poll" | "photo" | "voice" | "audio" | "animation" | "video" | "video_note" | "sticker" | "channel_chat_created" | "connected_website" | "delete_chat_photo" | "group_chat_created" | "invoice" | "left_chat_member" | "message_auto_delete_timer_changed" | "migrate_from_chat_id" | "migrate_to_chat_id" | "new_chat_members" | "new_chat_photo" | "new_chat_title" | "passport_data" | "pinned_message" | "proximity_alert_triggered" | "successful_payment" | "supergroup_chat_created" | "voice_chat_started" | "voice_chat_ended" | "voice_chat_participants_invited" | "document" | "caption" | "caption_entities" | "contact" | "dice" | "game" | "location" | "media_group_id" | "venue", undefined>> & import("@grammyjs/types/update").Update.New & import("@grammyjs/types/update").Update.NonChannel>>)>; | ||
/** | ||
@@ -286,3 +286,3 @@ * Registers some middleware for callback queries, i.e. the updates that | ||
*/ | ||
callbackQuery(trigger: MaybeArray<string | RegExp>, ...middleware: Array<Middleware<Filter<C, 'callback_query:data'>>>): Composer<C & Record<"update", import("@grammyjs/types/update").Update.CallbackQueryUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.CallbackQueryUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"callback_query", import("@grammyjs/types/close").CloseElement<import("@grammyjs/types/callback").CallbackQuery.DataCallbackQuery, "message" | "from" | "id" | "inline_message_id" | "game_short_name" | "data" | "chat_instance">>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.CallbackQueryUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.CallbackQueryUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"callback_query", import("@grammyjs/types/close").CloseElement<import("@grammyjs/types/callback").CallbackQuery.DataCallbackQuery, "message" | "from" | "id" | "inline_message_id" | "game_short_name" | "data" | "chat_instance">>>>; | ||
callbackQuery(trigger: MaybeArray<string | RegExp>, ...middleware: Array<Middleware<Filter<C, 'callback_query:data'>>>): Composer<C & Record<"update", import("@grammyjs/types/update").Update.CallbackQueryUpdate & Partial<Record<"channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"callback_query", import("@grammyjs/types/close").CloseElement<import("@grammyjs/types/callback").CallbackQuery.DataCallbackQuery, "message" | "from" | "id" | "inline_message_id" | "game_short_name" | "data" | "chat_instance">>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.CallbackQueryUpdate & Partial<Record<"channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"callback_query", import("@grammyjs/types/close").CloseElement<import("@grammyjs/types/callback").CallbackQuery.DataCallbackQuery, "message" | "from" | "id" | "inline_message_id" | "game_short_name" | "data" | "chat_instance">>>>; | ||
/** | ||
@@ -306,3 +306,3 @@ * Registers some middleware for game queries, i.e. the updates that | ||
*/ | ||
gameQuery(trigger: MaybeArray<string | RegExp>, ...middleware: Array<Middleware<Filter<C, 'callback_query:game_short_name'>>>): Composer<C & Record<"update", import("@grammyjs/types/update").Update.CallbackQueryUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.CallbackQueryUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"callback_query", import("@grammyjs/types/close").CloseElement<import("@grammyjs/types/callback").CallbackQuery.GameShortGameCallbackQuery, "message" | "from" | "id" | "inline_message_id" | "game_short_name" | "data" | "chat_instance">>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.CallbackQueryUpdate & Partial<import("@grammyjs/types/close").Boundary<import("@grammyjs/types/update").Update.CallbackQueryUpdate, "callback_query" | "update_id" | "channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query">> & Record<"callback_query", import("@grammyjs/types/close").CloseElement<import("@grammyjs/types/callback").CallbackQuery.GameShortGameCallbackQuery, "message" | "from" | "id" | "inline_message_id" | "game_short_name" | "data" | "chat_instance">>>>; | ||
gameQuery(trigger: MaybeArray<string | RegExp>, ...middleware: Array<Middleware<Filter<C, 'callback_query:game_short_name'>>>): Composer<C & Record<"update", import("@grammyjs/types/update").Update.CallbackQueryUpdate & Partial<Record<"channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"callback_query", import("@grammyjs/types/close").CloseElement<import("@grammyjs/types/callback").CallbackQuery.GameShortGameCallbackQuery, "message" | "from" | "id" | "inline_message_id" | "game_short_name" | "data" | "chat_instance">>> & import("./context").AliasProps<import("@grammyjs/types/update").Update.CallbackQueryUpdate & Partial<Record<"channel_post" | "chat_member" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "message" | "my_chat_member" | "pre_checkout_query" | "poll_answer" | "poll" | "shipping_query", undefined>> & Record<"callback_query", import("@grammyjs/types/close").CloseElement<import("@grammyjs/types/callback").CallbackQuery.GameShortGameCallbackQuery, "message" | "from" | "id" | "inline_message_id" | "game_short_name" | "data" | "chat_instance">>>>; | ||
/** | ||
@@ -309,0 +309,0 @@ * Registers middleware for inline queries. Telegram sends an inline query |
@@ -153,3 +153,3 @@ "use strict"; | ||
* @param text Text of the message to be sent, 1-4096 characters after entities parsing | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -166,3 +166,3 @@ * | ||
* @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername) | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -179,3 +179,3 @@ * | ||
* @param chat_id Unique identifier for the target chat or username of the target channel (in the format @channelusername) | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -192,3 +192,3 @@ * | ||
* @param photo Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -207,3 +207,3 @@ * | ||
* @param audio Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -220,3 +220,3 @@ * | ||
* @param document File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -233,3 +233,3 @@ * | ||
* @param video Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -246,3 +246,3 @@ * | ||
* @param animation Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -259,3 +259,3 @@ * | ||
* @param voice Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -273,3 +273,3 @@ * | ||
* @param video_note Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data.. Sending video notes by a URL is currently unsupported | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -286,3 +286,3 @@ * | ||
* @param media An array describing messages to be sent, must include 2-10 items | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -300,3 +300,3 @@ * | ||
* @param longitude Longitude of the location | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -314,3 +314,3 @@ * | ||
* @param longitude Longitude of new location | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -330,3 +330,3 @@ * | ||
* | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -350,3 +350,3 @@ * | ||
* @param address Address of the venue | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -364,3 +364,3 @@ * | ||
* @param first_name Contact's first name | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -378,3 +378,3 @@ * | ||
* @param options A list of answer options, 2-10 strings 1-100 characters each | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -391,3 +391,3 @@ * | ||
* @param emoji Emoji on which the dice throw animation is based. Currently, must be one of “🎲”, “🎯”, “🏀”, “⚽”, or “🎰”. Dice can have values 1-6 for “🎲” and “🎯”, values 1-5 for “🏀” and “⚽”, and values 1-64 for “🎰”. Defaults to “🎲” | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -419,3 +419,3 @@ * | ||
* @param user_id Unique identifier of the target user | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -432,3 +432,3 @@ * | ||
* | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -445,3 +445,3 @@ * | ||
* @param user_id Unique identifier of the target user | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -458,3 +458,3 @@ * | ||
* @param user_id Unique identifier of the target user | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -471,3 +471,3 @@ * | ||
* @param permissions An object for new user permissions | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -485,3 +485,3 @@ * | ||
* @param permissions An object for new user permissions | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -497,3 +497,3 @@ * | ||
* | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -510,3 +510,3 @@ * | ||
* @param user_id Unique identifier of the target user (if unspecified, defaults to author of update) | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -568,3 +568,3 @@ * | ||
* | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -581,3 +581,3 @@ * | ||
* @param invite_link The invite link to edit | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -648,3 +648,3 @@ * | ||
* @param message_id Identifier of a message to pin | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -765,3 +765,3 @@ * | ||
* | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -778,3 +778,3 @@ * | ||
* @param text New text of the message, 1-4096 characters after entities parsing | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -794,3 +794,3 @@ * | ||
* | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -811,3 +811,3 @@ * | ||
* @param media An object for a new media content of the message | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -827,3 +827,3 @@ * | ||
* | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -843,3 +843,3 @@ * | ||
* | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -874,3 +874,3 @@ * | ||
* @param sticker Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -890,3 +890,3 @@ * | ||
* @param results An array of results for the inline query | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -909,3 +909,3 @@ * | ||
* @param prices Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -923,3 +923,3 @@ * | ||
* @param ok Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible) | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -936,3 +936,3 @@ * | ||
* @param ok Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems. | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -962,3 +962,3 @@ * | ||
* @param game_short_name Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather. | ||
* @param other remaining parameters, confer the official reference below | ||
* @param other Remaining parameters, confer the official reference below | ||
* @param signal optional `AbortSignal` to cancel the request | ||
@@ -965,0 +965,0 @@ * |
@@ -29,8 +29,2 @@ /// <reference types="node" /> | ||
export declare type Opts<M extends keyof GrammyTypes["Telegram"]> = GrammyTypes["Opts"][M]; | ||
/** Utility type providing a promisified version of Telegram */ | ||
export declare type TelegramP = GrammyTypes["TelegramP"]; | ||
/** Utility type providing a version Telegram where all methods return ApiResponse objects instead of raw data */ | ||
export declare type TelegramR = GrammyTypes["TelegramR"]; | ||
/** Utility type providing a version Telegram where all methods return Promises of ApiResponse objects, combination of TelegramP and TelegramR */ | ||
export declare type TelegramPR = GrammyTypes["TelegramPR"]; | ||
/** This object represents the content of a media message to be sent. It should be one of | ||
@@ -37,0 +31,0 @@ - InputMediaAnimation |
{ | ||
"name": "grammy", | ||
"description": "grammY core package ported to Node.js", | ||
"version": "0.1.4", | ||
"version": "0.2.0", | ||
"author": "KnorpelSenf", | ||
@@ -18,3 +18,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@grammyjs/types": "^1.0.1", | ||
"@grammyjs/types": "^1.0.2", | ||
"abort-controller": "^3.0.0", | ||
@@ -21,0 +21,0 @@ "debug": "^4.3.1", |
@@ -1,12 +0,10 @@ | ||
# grammY for Node | ||
# grammY | ||
If you haven't already, [install Node.js](https://nodejs.org/en/download/). | ||
The grammY package lets you easily write Telegram bots. Here is a quickstart for you to get started, but note that a better explanation is [in our repo on GitHub](https://github.com/grammyjs/grammY). | ||
## Quickstart | ||
### Simple example | ||
Talk to [@BotFather](https://t.me/BotFather) to create a new Telegram bot and obtain a _bot token_. | ||
Paste the following code into a new file `example-bot.js`. | ||
Paste the following code into a new file `bot.js`. | ||
@@ -18,8 +16,12 @@ ```js | ||
// Create bot | ||
const bot = new Bot('<your-bot-token>') | ||
// Create bot object | ||
const bot = new Bot('') // <-- place your bot token inside this string | ||
// Listen for messages | ||
bot.command('start', ctx => ctx.reply('Welcome! Send me your pics!')) | ||
bot.on('message:photo' ctx => ctx.reply('Nice photo!')) | ||
bot.command('start', ctx => ctx.reply('Welcome! Send me a photo!')) | ||
bot.on('message:text', ctx => ctx.reply('That is text and not a photo!')) | ||
bot.on('message:photo', ctx => ctx.reply('Nice photo! Is that you?')) | ||
bot.on('edited_message', ctx => ctx.reply('Ha! Gotcha! You just edited this!', { | ||
reply_to_message_id: ctx.editedMessage.message_id | ||
})) | ||
@@ -30,21 +32,8 @@ // Launch! | ||
**Congratulations!** | ||
You have successfully created your first Telegram bot for Node. | ||
**Congratulations!** You have successfully created your first Telegram bot. | ||
You can run it like so: | ||
```shellscript | ||
node example-bot.js | ||
```bash | ||
node bot.js | ||
``` | ||
### Advanced example | ||
TODO: create more complicated example | ||
```ts | ||
const token = process.env.BOT_TOKEN; | ||
``` | ||
```shellscript | ||
node example-bot.js | ||
``` |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
491621
8062
38
Updated@grammyjs/types@^1.0.2