Squirrel-Network / nebula8

Open source bot to administer a telegram group with different functionalities and blacklist
https://t.me/nebulanewsbot
Apache License 2.0
31 stars 14 forks source link

Creation of RestFul API #6

Closed BluLupo closed 3 years ago

BluLupo commented 4 years ago

This bot needs the API for dynamic bot management from a possible dashboard.

The bees that serve are the following divided by methods:

123456789 == Telegram Id

At present the most important is the /superban API, the others are optional, the API can be implemented in Python 3.6+ (Flask or extend the existing code in Nebula) or PHP 7.0+ (Laravel or pure PHP) or NodeJS

Find the method that calls the superban table here: https://github.com/Squirrel-Network/nebula8/blob/master/core/database/repository/superban.py

and this is the structure of the table:

CREATE TABLE `superban_table` (
  `id` int (11) NOT NULL AUTO_INCREMENT,
  `user_id` varchar (50) NOT NULL,
  `motivation_text` varchar (255) NOT NULL,
  `user_date` datetime NOT NULL,
  `id_operator` varchar (50) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY ʻuser_id_key` (ʻuser_id`)
) ENGINE = InnoDB AUTO_INCREMENT = 327685 DEFAULT CHARSET = utf8mb4

Our server has the following characteristics: Webserver: NGINX with certbot for SSL Database: MariaDB Other: Docker with Portainer and Swarm and NodeJS with NVM

BluLupo commented 3 years ago

https://github.com/Squirrel-Network/api_nebula