Coder Social home page Coder Social logo

sagleft / diano-bot Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 194 KB

bot for transporting content between messengers

Home Page: https://udocs.gitbook.io/utopia-api/

License: MIT License

Shell 0.17% PHP 94.02% Dockerfile 1.83% Go 3.99%
content-automation telegram utopia utopia-api utopia-ecosystem utopia-p2p web3

diano-bot's Introduction

logo

This bot allows you to periodically copy content from one messenger to another.

Supported Clients:

Requirements

  • Docker 2.2+

How to run

  1. Install Utopia Messenger, create account file with password password.

  2. Copy the repository or download it as a zip file:

git clone https://github.com/Sagleft/diano-bot && cd diano-bot
  1. Put Utopia account file in the bot repository directory. Name a file account.db

  2. Make changes to the config file docker-compose.yml

  • CRON_SPEC - determines how often to post in the channels. Example: every 1m, every 1h

or a cron setting of the kind: <Minute> <Hour> <Day_of_the_Month> <Month_of_the_Year> <Day_of_the_Week>

example:

0 2 * * * - schedule a cron to execute at 2 am daily.

  1. Install docker-compose if it is not already on the system.

Examples:

  1. Create content redirects

To create a new redirect contents task create a .json file in the redirects folder.

For example, 'export_NationGeographic.json'.

Content example:

{
	"source": {
		"tag": "telegram",
		"channelid": "NationGeographic"
	},
	"destination": {
		"tag": "utopia",
		"channelid": "02FAD8A273A72241F2D5B725742B53B0"
	},
	"params": {
		"limit": 1
	}
}
  1. then run the command in the terminal to run bot:
docker-compose up

or run in background:

docker-compose up -d

How to find bot logs

docker container logs diano-bot_core_1

where

  • tag: technical parameter, messenger name;
  • channelid: channel or group ID in the messenger;
  • source section: where do we get the posts;
  • destination section: where we will post posts;
  • params section: other parameters;
  • limit: number of posts for transportation;

Solve problems

Channel Limit Problem

In Utopia, you can create a maximum of 10 channels. There is a way to solve this problem. You will need to create additional accounts on which you will create channels. Next, you add the bot account to these channels and give it moderator rights.

SSL problem

Get the correct directory for your certs to be placed by default with this

php -r "print_r(openssl_get_cert_locations()['default_cert_file']);"

Then use this to get the cert and put it in the default location found from the code above

wget http://curl.haxx.se/ca/cacert.pem -O <default location>

example:

wget http://curl.haxx.se/ca/cacert.pem -O /etc/pki/tls/cert.pem --no-check-certificate

udocs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.