Giter Site home page Giter Site logo

hedsmanbot's Introduction

hedsmanbot(telegram bot)

A java project run to recognize and remove annoying bots and messages in telegram.

Before you start:

You have to have these ids:

  1. Your supergroup chatId, To obtain it, First, you have to add your bot as an admin member to your soupergroup. After sending first message, call api https://api.telegram.org/bot[your bot token]/getUpdates, after that, find group chat id in the json reponse.
  2. Ids of those admins that you want to access to the bot command. For this, You want an admin to send a message to your bot PM and then you can find its id by calling api https://api.telegram.org/bot[your bot token]/getUpdates.
  3. Ids of the channel that all of you soupergroup admins can join it. Your bot will send logs to the channel. The logs would be about what messages it has deleted and what bots it has kicked.To achive your chnnel id, you have to follow these instructions, First, Create a public channel with desired username, after, like above cases, call api https://api.telegram.org/bot[your bot token]/getUpdates to obtain the id, then, copy the id of channel, and finaly,change channel type to private.

And set those ids at:

  1. Set an id of your soupergroups at the TelegramLongPollingBot.existGroup() ,also at TelegramLongPollingBot.findAllGroupIdsByAdminChatId().
  2. Set all ids of your supergroup admins at TelegramLongPollingBot.isAsAdmin().
  3. Set your channels id at TelegramLongPollingBot.getChannelIdBygroupId().

About using application resources:

  1. The application has not any api or a user interface like home.html, so you can only see the application's status by tracing log file or seeing every respone to every command.
  2. Set the allow write permission on the expression.xml file located in root directory.
  3. For keeping my token private, I set an Environment variable with name bot.token and value my bot token.
  4. Clone or download from the develop branch

How dose the bot work:

  • As i mentioned, be sure your id is existed at TelegramLongPollingBot.isAsAdmin().
  • You can start work on the bot command by sending /start at the bot's PM.
  • The bot receives you expressions and save them into the expression.xml file.
  • After kicking a bot member or deleting an annoying message, bot would send a log message into admins channels.

Please feel free to contact me at telegram @abbasghahreman

hedsmanbot's People

Contributors

usespring avatar

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.