0.0.3 • Published 6 months ago

@icntower/telegraf-session-dynamodb v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@icntower/telegraf-session-dynamodb

This package provides dynamodb storage adapter for Telegraf v4.12+ sessions.

DynamoDB

Install the official DynamoDB driver alongside this module.

npm i @icntower/telegraf-session-dynamodb @aws-sdk/client-dynamodb

Usage:

import { DynamoDB } from "@icntower/telegraf-session-dynamodb";

const store = DynamoDB({
  config: {
    region: process.env.AWS_DEFAULT_REGEON,
    endpoint: process.env.DOCUMENT_API_ENDPOINT,
    credentials: {
      accessKeyId: process.env.AWS_ACCESS_KEY_ID,
      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
    },
  },
});

const bot = new Telegraf(token, opts);
bot.use(session({ store }));

// the rest of your bot

To reuse an existing DynamoDB client, use DynamoDB({ client }) instead.

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago