You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Optimized Notifications | Reliable Telegram delivery out of the box. No complex setup required. |
23
-
| From Pull to Push | Trigger relevant, contextual messages based on wallet activity. Keep your users informed in real-time without them having to check your dashboard. |
24
-
| Telegram Bot | Prebuilt bot with wallet linkage and user controls. No need to build your own interface. |
25
-
| Telegram Mini App (Coming Soon) | Richer Telegram UI via a lightweight, integrated Telegram Mini App. |
26
-
| Onboarding Component | React component for instant onboarding. Users click a link or scan a QR. No wallet connection needed. |
27
-
| Zero Installs | No apps, no browser extensions. Everything runs through Telegram. |
28
-
| Easy Deployment | Runs as a single-node service. Self-host or deploy in your cloud infra. |
29
-
| White Label | Customize components with your own branding and front-end logic. |
30
-
| Data Flexibility | Compatible with SQLite, Postgres, MySQL, or MongoDB. Use your preferred stack. You own your user's data, eliminating exposure to third-party risks. |
31
-
| Built for Simplicity | Deliver what drives user engagement, retention, and re-activation. DMe handles delivery logic; you focus on wallet signals. |
32
-
| Attribution Dashboard (Coming Soon) | Track delivery, opens, and basic interaction metrics to measure messaging impact. |
33
-
| Open Source | This framework is **fully open source**. You can inspect, extend, and contribute to its codebase. It’s actively maintained and open to community feedback and contributions. |
| Optimized Notifications | Reliable Telegram delivery out of the box. No complex setup required.|
24
+
| From Pull to Push | Trigger relevant, contextual messages based on wallet activity. Keep your users informed in real-time without them having to check your dashboard.|
25
+
| Telegram Bot | Prebuilt bot with wallet linkage and user controls. No need to build your own interface.|
26
+
| Telegram Mini App (Coming Soon) | Richer Telegram UI via a lightweight, integrated Telegram Mini App.|
27
+
| Onboarding Component | React component for instant onboarding. Users click a link or scan a QR. No wallet connection needed.|
28
+
| Zero Installs | No apps, no browser extensions. Everything runs through Telegram.|
29
+
| Easy Deployment | Runs as a single-node service. Self-host or deploy in your cloud infra.|
30
+
| White Label | Customize components with your own branding and front-end logic.|
31
+
| Data Flexibility | Compatible with SQLite, Postgres, MySQL, or MongoDB. Use your preferred stack. You own your user's data, eliminating exposure to third-party risks.|
32
+
| Built for Simplicity | Deliver what drives user engagement, retention, and re-activation. DMe handles delivery logic; you focus on wallet signals.|
33
+
| Attribution Dashboard (Coming Soon) | Track delivery, opens, and basic interaction metrics to measure messaging impact. |
34
+
| Open Source | This framework is **fully open source**. You can inspect, extend, and contribute to its codebase. It’s actively maintained and open to community feedback and contributions. |
34
35
35
36
## Getting Started
36
37
@@ -148,8 +149,8 @@ The example also demonstrates how commands can be customized—for instance, obt
148
149
149
150
The monorepo is organized into the following packages:
150
151
151
-
*`packages/server`: The main server application that runs the Telegram bot and handles user interactions, message dispatching, and job scheduling.
152
-
*`packages/onboarding-modal`: A React component that provides a user-friendly onboarding experience for linking Telegram accounts with their wallet addresses.
152
+
-`packages/server`: The main server application that runs the Telegram bot and handles user interactions, message dispatching, and job scheduling.
153
+
-`packages/onboarding-modal`: A React component that provides a user-friendly onboarding experience for linking Telegram accounts with their wallet addresses.
153
154
154
155
The server package is built with TypeScript and uses the [grammy](https://grammy.dev/) framework for Telegram bot interactions, [Prisma](https://www.prisma.io/) for database management, and [node-cron](https://www.npmjs.com/package/node-cron) for scheduling jobs.
155
156
@@ -181,12 +182,27 @@ In this case, you would add an `aave.ts` service to the **services** folder and
181
182
182
183
The DMe framework includes a set of predefined commands that users can use to interact with the Telegram bot. These commands allow users to manage their subscriptions and get information about their linked wallets.
|`/start [address]`| Starts a conversation with the bot. If a wallet address is provided, it is linked to the user. |
187
-
|`/add <address>`| Links an additional wallet address to the user's Telegram account. |
188
-
|`/remove <index>`| Unlinks a wallet address from the user's Telegram account. The index is the number to the left of the address provided in `/list`. |
189
-
|`/list`| Lists all wallet addresses linked to the user's Telegram account. |
|`/start [address]`| Starts a conversation with the bot. If a wallet address is provided, it is linked to the user. |
188
+
|`/add <address>`| Links an additional wallet address to the user's Telegram account. |
189
+
|`/remove <index>`| Unlinks a wallet address from the user's Telegram account. The index is the number to the left of the address provided in `/list`. |
190
+
|`/list`| Lists all wallet addresses linked to the user's Telegram account. |
191
+
192
+
## Queuing Messages
193
+
194
+
The MessageService is the main component you will be using to queue messages to users, ensuring reliable delivery with built-in rate limiting and retry logic. All messages should be created using the `MessageService.create` or `MessageService.createForUser` methods.
195
+
196
+
`MessageService.create(content: string, address: string, options?: MessageOptions)` Creates a message targeted for a certain wallet address. The message will be queued and delivered to all users that have linked that address. This should be used to send messages to users based on wallet activity.
197
+
198
+
`MessageService.createForUser(content: string, userId: number, options?: MessageOptions)` Creates a message targeted for a specific user. This should be used to send messages that are not related to wallet activity, such as welcome messages or responses to user commands.
199
+
200
+
`MessageOptions` include:
201
+
202
+
- priority: number - Sets the priority of the message. Higher priority messages are sent first. This allows you to prioritize certain messages over others. Default is 0 for create, and 1000 for createForUser. This is to ensure that command replies are sent before any other queued messages.
203
+
- maxAttempts: number - Sets the maximum number of attempts to send the message. Default is 5, this is configurable via the `MAX_ATTEMPTS` environment variable.
204
+
205
+
Messages are formatted to support **MarkdownV2** when queued. See the [Telegram documentation](https://core.telegram.org/bots/api#markdownv2-style) for more details.
190
206
191
207
## Onboarding Modal Component
192
208
@@ -195,19 +211,19 @@ The framework includes a React component that can be integrated into your React
0 commit comments