https://github.com/losparviero/grammyuser
User management database middleware plugin for grammY framework!
https://github.com/losparviero/grammyuser
grammy grammy-plugin grammyjs telegram telegram-bot telegrambot
Last synced: 8 months ago
JSON representation
User management database middleware plugin for grammY framework!
- Host: GitHub
- URL: https://github.com/losparviero/grammyuser
- Owner: losparviero
- License: mit
- Created: 2023-08-25T10:18:35.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-25T14:35:44.000Z (about 2 years ago)
- Last Synced: 2024-04-26T08:47:08.623Z (over 1 year ago)
- Topics: grammy, grammy-plugin, grammyjs, telegram, telegram-bot, telegrambot
- Language: JavaScript
- Homepage: https://npmjs.com/grammyuser
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# grammYUser
User management database middleware plugin for [grammY](https://github.com/grammyjs/grammy) framework!
### Features
Middleware for grammY which lets you implement management of users using a database.
Supports a global blacklist feature through column 'isBlacklisted' (0 or 1) in the database.
Supports 'lastSeen' feature for users interacting with bots, along with a 'firstSeen' column storing dates pertaining to the first time a user messaged the bot to the last or recent time.
Stores user records such as Telegram user ID, username, firstName and lastName for user management.
### Usage
1. grammYUser depends on the mysql2 package.
```node
npm i mysql2
```
In working directory of your bot project.
2. Copy the plugin code from ```user.js``` and paste it in your Telegram bot code.
3. Run ```npm start``` to create or initiliaze the databalse.
### License
MIT ©️ Zubin