The NEST Prize Bot is a tool for the activity of the NEST community.

Overview

NEST Prize Bot

The NEST Prize Bot is a tool developed by our team for the activity of the NEST community. It can record the receipt of Prize and export them.

This repository contains:

  1. The bot main program
  2. The contract interface used by the bot
  3. Get the function source code of the condition interface

Table of Contents

Background

Our development team has developed countless telegram bots for rewarding active users, which is a very exhausting job. Therefore, we decided to develop a general-purpose bot that can help members of the NEST community to distribute and receive NEST red packets in Telegram groups.

The goals for this repository are:

  1. Record the receipt of NEST Prize
  2. Export all the receipt data
  3. Reduce the cost of reward distribution and reduce transaction errors
  4. Anti cheating

Install

This project uses a serverless architecture design, so you need to be familiar with AWS related services, including: Lambda, DynamoDB, IAM, CloudWatch, etc.

$ npm install

Usage

You need to replace some configuration in the source code, including:

  1. Create a new Telegram bot account and configure its token in Lambda's environment variables
  2. Modify the whitelist of administrators in the original code, WHITELIST
  3. Need to create a DynamoDB database

DynamoDB Design

Table: nest-prize

Attribute Name Type Description
chat_id Number pk of table
message_id Number sk of table
status String pk of GSI(status-index)

Table: nest-prize-users

Attribute Name Type Description
user_id Number pk
wallet Number pk of GSI(wallet-index)

Example Bot

NEST Prize Bot

Related Efforts

Maintainers

@tunogya.

Contributing

Feel free to dive in! Open an issue or submit PRs.

Contributors

This project exists thanks to all the people who contribute.

@kitty-tin

License

MIT © NEST Protocol

You might also like...

This code can be used to log activity on yours Polytoria Games.

This code can be used to log activity on yours Polytoria Games.

polyGameLogger This code can be used to log activity on yours Polytoria Games. current version: 0.1.1 Basic Setup First of all, you need to create a .

Jun 13, 2022

The website which can help you to organize your daily or weekly activities and review them when you need them. you can add, remove and delete an activity

To Do list To do project is webpack project that list activities someone can do at a specific time In this TO-DO list, you can add or remove you activ

Jul 21, 2022

Portable Activity Timeline that draws the Timeline based on data given in JSON or CSV format

Portable Activity Timeline that draws the Timeline based on data given in JSON or CSV format

Portable Activity Timeline that draws the Timeline based on data given in JSON or CSV format. By clicking on any activity a detailed modal window is displayed. Initially developed for post incident investigations to get a overview of the situation in an it-environment.

Oct 11, 2022

A REST API which provides you the information of any discord account including their Spotify & VS-Code activity!

Friday A REST API which provides you the information of any discord account including their Spotify & VS-Code activity! This is an open sourced reposi

Jan 4, 2023

simulates MEV activity from an array of unique searchers; used for testing infra

simulates MEV activity from an array of unique searchers; used for testing infra

mev-flood the game Call bid, placing a bet by setting value, and send the highest bid (which may be in addition to others' bids in the block) before c

Jan 9, 2023

A simple application used to organize your day to day activity. Tasks can be added and removed from this list.

Minimalist ToDo List A minimalist list of TODOs. Built With HTML, CSS, JavaScript Webpack Jest NPM Node Getting Started In order to obtain a local cop

Sep 9, 2022

Buildable's core open-source offering for actions that makes it easy to collect, centralize and action your backend system activity

Buildable's core open-source offering for actions that makes it easy to collect, centralize and action your backend system activity

What are Action Templates? Action Templates are open-source functions that save developers hundreds of hours when integrating databases, apps and othe

Nov 5, 2022

A Nest rewrite of crystal, the SOS Discord bot

crystal-nest A Nest rewrite of crystal, the SOS Discord bot Explore the docs » Report Bug · Request Feature Table of Contents About The Project Built

Dec 22, 2022
Comments
  • ctx.session storage intent is delayed

    ctx.session storage intent is delayed

    Now, we use bot.use(session()) to store the intent of user's input.

    We found that there was a long delay in updating and reading data during a spike in usage.

    We plan to write the changes to our database. Wish us good luck.

    opened by tunogya 1
  • Repeated Liquidate BUG

    Repeated Liquidate BUG

    We found a big bug in the recent use process. Clicking the liquidation button once will lead to the issuance of more Prize. At present, the analysis results and preliminary solutions have been obtained.

    Reproduction process:

    1. DynamoDB uses a pre-made billing model, 1-10. If the AWS performance scheduling is not timely, the request will fail.
    2. Since DynamoDB does not have a batch update function, a for loop is set in the program to update the red envelopes. Multiple write requests will be generated in a short period of time.
    3. Due to the above reasons, the write request will fail, and if the robot fails, it will be repeated, resulting in multiple transfer transactions.

    solution:

    1. DynamoDB enables on-demand mode.
    2. Optimize the structure of DynamoDB and use batch delete instead of for loop to update one by one.
    3. The robot only generates a settlement slip, and the maximum number of transactions allowed per block is packaged at a time. Batch settlement is handled by another Lambda function.
    opened by tunogya 1
  • Balance overflow

    Balance overflow

    We set up a balance field, whose initial value is set to the total amount of the red envelope, and the balance will be reduced each time you grab it. In theory there shouldn't be a negative balance, but it does happen.

    We intend to use Redis to solve the problem of read and write latency. Or use telegram session.

    opened by tunogya 1
Owner
NEST Protocol
Truly Decentralized Oracle, Nodeless Permissionless Quotation, On-chain Verification.
NEST Protocol
A community website built by the community for the community (Hacktoberfest 2022) :tada:

Hacktoberfest 2022 ?? : Built by the community for the community! This repository is an initiative which aims to help beginners kickstart their open-s

Your First Open Source Project 5 Oct 12, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
A tool for generating retrospectives for GitHub activity.

retrogen A tool for generating retrospectives for GitHub activity. Pacakges @retrogen/core: The core functionality of retrogen. @retrogen/generate: A

cutenode 18 Apr 25, 2022
A Kubernetes monitoring tool to visualize large-scale activity and real-time comprehensive metrics within your cluster.

Armada A light-weight Kubernetes health monitoring tool. Summary Armada is an open-source tool for monitoring the health of your Kubernetes cluster. I

OSLabs Beta 81 Nov 2, 2022
Hasbik is a community based social token and the new paradigm in the crypto space. With the goal to build a community around a crypto token.

Hasbik is a community based social token and the new paradigm in the crypto space. With the goal to build a community around a crypto token.

null 2 Jan 5, 2022
A daily activity tracking application that helps to organize your daily tasks and keep track of tasks that have been completed, or yet to be completed.

To-Do-List This is my To-Do List project in the Microverse curriculum. Built With HTML CSS Javascript (Webpack) GitHub Live Demo Live Demo Link Gettin

Hammed Adisa 8 May 7, 2022
An Advanced Activity Command Using Discord-Together Package For Discord.jsv13 with buttons

Active An Advanced Activity Bot Using Discord-Together Package For Discord.jsv13 with buttons. Report Bug · Request Feature Usage. How to run the bot?

Hypwreck 11 Feb 15, 2022
The project is a To-Do list project to help plan daily, weekly or monthly activity. I used Html, CSS and JavaScript Technology to execute the project.

<<<<<<< HEAD To Do List This project is geared towards applying acguired skills for development of my porfolio through the following practices: Create

Victor Efosa Osagie 6 Dec 19, 2022