Skip to content

berkus/cpppostbot

 
 

Repository files navigation

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.

About

A simple C++ Telegram Channels Post helper bot

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • C++ 98.7%
  • C 1.1%
  • Other 0.2%