skip to Main Content

Prompt a bot for a group of telegrams that would exclude visitors whose name contains the word "sex" and so on.

2

Answers


  1. Please take a look at this site. I think your question gets an answer here!!!

    Login or Signup to reply.
  2. Please specify the language you are using to code the bot.

    You can block messages that contains prohibited word. (JAVA Code) –

    @Override
    public void onUpdateRecieved(Update update){
        if(update.getMessage().getText() == "<prohibited word>"){
            DeleteMessage deleteMessage = new DeleteMessage();
            deleteMessage.setChatId(update.getMessage().getChatId().toString());
            deleteMessage.setMessageId(update.getMessage().getMessageId());
            try {
                execute(deleteMessage);
            } catch (TelegramApiException e) {
                e.printStackTrace();
            }
        }
    }
    

    Also I will suggest you to read Telegram Bot API Documentation.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search