Telegram core for botnorrea
- nodejs
18.19.0
- serverles framework
3
- @aws-sdk/client-dynamodb
3.388.0
- @aws-sdk/lib-dynamodb
3.388.0
- @xenova/transformers
2.8.0
- axios
1.4.0
- dayjs
1.11.10
- http-status
1.6.2
- mongoose
8.0.0
npm install
You can copy the file config/dev_mock.json
, fill with your credentials and required data and rename to dev.json
or prod.json
according to your requirements, here the short explanation about environment variables
BOT_USERNAME
: bot nameTELEGRAM_BOT_TOKEN
: telegram bot token given by Bot FatherAUTH_URL
: your auth0 url from auth0MONGO_USER
: mongo database userMONGO_PASSWORD
: mongo database passwordMONGO_HOST
: mongo database hostMONGO_DATABASE
: mongo database database
npm run local:telegramWebhook
- local:telegramAuthorizer
- local:telegramSetWebhook
- local:telegramWebhook
- local:telegramWebhookCallback
- local:telegramSendMessage
- local:telegramSendPhoto
- local:telegramSendVideo
- local:telegramDebug
- local:telegramGetChats
- local:telegramCleanReplyMarkup
- local:telegramMembersMute
- local:telegramMembersUnmute
dev:deploy
: deploy lambdas to development environmentdev:destroy
: deploy all lambdas resources from development environmentprod:deploy
: deploy lambdas to production environmentprod:destroy
: deploy all lambdas resources from production environment
/telegram/set-webhook
- method:
POST
- body:
application/json
{ url: string; }
- method:
/telegram/webhook
- method:
POST
- body:
application/json
interface UpdateTg { update_id: number; message?: MessageTg; callback_query?: { id: string; from: UserTg; message: MessageTg; chat_instance: string; data: string; }; }
- method:
/telegram/send-message
- method:
POST
- body:
application/json
interface SendMessageParams { chat_id: number | string; text: string; message_thread_id?: number; parse_mode?: FormattingOptionsTg; entities?: Array<EntityTg>; protect_content?: boolean; reply_to_message_id?: number; reply_markup?: { inline_keyboard: Array<any>; }; has_spoiler?: boolean; }
- method:
/telegram/edit-message
- method:
POST
- body:
application/json
interface EditMessageParams { chat_id: number | string; message_id: number | string; text: string; message_thread_id?: number; parse_mode?: FormattingOptionsTg; entities?: Array<EntityTg>; protect_content?: boolean; reply_to_message_id?: number; reply_markup?: { inline_keyboard: Array<any>; }; has_spoiler?: boolean; }
- method:
/telegram/send-photo
- method:
POST
- body:
application/json
interface SendPhotoParams { chat_id: number | string; photo: string; caption?: string; parse_mode?: FormattingOptionsTg; caption_entities?: Array<EntityTg>; reply_to_message_id?: number; allow_sending_without_reply?: boolean; protect_content?: boolean; reply_markup?: { inline_keyboard: Array<any>; }; has_spoiler?: boolean; }
- method:
/telegram/send-video
- method:
POST
- body:
application/json
interface SendVideoParams { chat_id: number | string; video: string; caption?: string; parse_mode?: FormattingOptionsTg; caption_entities?: Array<EntityTg>; reply_to_message_id?: number; allow_sending_without_reply?: boolean; protect_content?: boolean; reply_markup?: { inline_keyboard: Array<any>; }; has_spoiler?: boolean; }
- method:
/telegram/debug
- method:
POST
- body:
application/json
interface UpdateTg { update_id: number; message?: MessageTg; callback_query?: { id: string; from: UserTg; message: MessageTg; chat_instance: string; data: string; }; }
- method:
/telegram/get-chats
- method:
POST
- body:
application/json
{ user: number | string; chats: Array<number | string>; }
- method:
/telegram/clean-reply-markup
- method:
POST
- body:
application/json
{ chatId: number | string; messageId: number | string; }
- method:
/telegram/members/mute
- method:
POST
- body:
application/json
interface UpdateTg { update_id: number; message?: MessageTg; callback_query?: { id: string; from: UserTg; message: MessageTg; chat_instance: string; data: string; }; }
- method:
/telegram/members/unmute
- method:
POST
- body:
application/json
interface UpdateTg { update_id: number; message?: MessageTg; callback_query?: { id: string; from: UserTg; message: MessageTg; chat_instance: string; data: string; }; }
- method:
{
"key": "/debug",
"createdAt": {
"$date": "2023-11-12T20:00:17.543Z"
},
"enabled": true,
"updatedAt": {
"$date": "2023-11-12T20:00:17.543Z"
},
"url": ""
}