GithubHelp home page GithubHelp logo

berkus / cpppostbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from failsbot/cpppostbot

0.0 2.0 0.0 86 KB

A simple C++ Telegram Channels Post helper bot

CMake 0.23% C++ 98.70% C 1.05% Shell 0.01%

cpppostbot's Introduction

Channel Post helper bot

Configuration

  • Fill in the ./cfg/channelid with your channel ID and the ./cfg/channelname with your channel name for the bot, or else it can't help you with posting;
  • Fill in the ./cfg/ownerid and ./cfg/adminsids your Telegram account ID (or else you can't use admin and post commands);
  • Get a token and bot username from the @BotFather bot and fill in the file botkey.h;
  • Build bot via ./build.sh (or directly run the cmake in output directory with arguments);
  • Run in shell / cron / .sh-script / etc.
  • Have fun!

Dependencies

  • C++11;
  • cmake;
  • curl;
  • nlohmann json (file json.hpp);
  • to_string workaround for Android NDK. You may enable it while configuring the cmake build.

Available Commands

  • /addadmin - adds a new admin for your channel. The bot will ask you user ID or @username of new admin. This user can post messages to your channel using your post command;
  • /cancel - cancels current command;
  • /removeadmin - removes admin from list. The bot will ask you user ID or @username of admin. Use the /cancel if you don't want to remove admin;
  • post command (default /post, see "Customizing Post Command" for change its name) - create a new post. This command is available only for users which user id is written in line of file ./cfg/adminsids or @username is written in line of file ./cfg/adminsnames. After using that command the bot will ask you for a message. So far it supports image messages, possible in future in will support any groups of messages.

Customizing Post Command

You can change the post command name writing the quoted string into the ./cfg/postcommandname file.

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.