X
X
xxxfdd2021-04-30 10:34:02
JavaScript
xxxfdd, 2021-04-30 10:34:02

How to make a telegram bot to block links?

I once saw an article about it but now I can't find it. It's just that there is a problem that people at one in the morning throw links to different groups and I need to write a bot that will block all this.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
ProjectSoft, 2018-09-17
@HarviSpecter

https://jsfiddle.net/uhzbqfnc/

M
Maxim Timofeev, 2018-09-17
@webinar

You are responsible for changing the text
; it works 1 time upon loading and only if at the time of loading the element with the spoiler-body class also has the opened class.
If you want this code to work sometime, then you need to insert it into a function that will work on some event. For example on click:

$('.spoiler-title').on('click',function(){
    $('.spoiler-title').html('Скрыть текст');
});

S
skilet16, 2021-04-30
@skilet16

You can create a parser that will check each message for characters that are often used in links (http, .com, @ ...)
There is a smarter solution - How to find links in text using python3?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question