Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/telegram_bot_api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/telegram_bot_api",
"version": "0.3.11",
"version": "0.3.12",
"description": "Pipedream Telegram_bot_api Components",
"main": "telegram_bot_api.app.mjs",
"keywords": [
Expand All @@ -10,7 +10,7 @@
"homepage": "https://pipedream.com/apps/telegram_bot_api",
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"dependencies": {
"@pipedream/platform": "^0.9.0",
"@pipedream/platform": "^3.0.3",
"node-telegram-bot-api": "^0.54.0",
"uuid": "^8.3.2"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,37 @@ export default {
key: "telegram_bot_api-message-updates",
name: "New Message Updates (Instant)",
description: "Emit new event each time a Telegram message is created or updated.",
version: "0.1.5",
version: "0.1.6",
type: "source",
dedupe: "unique",
props: {
...base.props,
chatId: {
propDefinition: [
base.props.telegramBotApi,
"chatId",
],
optional: true,
},
},
hooks: {
...base.hooks,
async deploy() {
if (this.chatId) {
const { id } = await this.telegramBotApi.sdk().getChat(this.chatId);
this._setChatId(id);
}
await base.hooks.deploy.call(this);
},
},
methods: {
...base.methods,
_getChatId() {
return this.db.get("chatId");
},
_setChatId(chatId) {
this.db.set("chatId", chatId);
},
getMeta(event, message) {
return {
id: event.update_id,
Expand All @@ -26,6 +52,12 @@ export default {
},
processEvent(event) {
const message = event.edited_message ?? event.message;
if (this.chatId) {
const chatId = this._getChatId();
if (chatId && chatId != message?.chat?.id) {
return;
}
}
this.$emit(event, this.getMeta(event, message));
},
},
Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading