extract links, delete incoming msg, add sender to reply

This commit is contained in:
Ghytro
2024-11-07 15:49:07 +03:00
parent d453168457
commit 7e78811724
4 changed files with 162 additions and 4 deletions

6
bot/utils.py Normal file
View File

@ -0,0 +1,6 @@
def find_all_string_entries(s: str, sub: str) -> list[int]:
result = []
for i in range(len(s)-len(sub)+1):
if s[i:i+len(sub)] == sub: # в питоне точно сравнение строк лексикографически? (забыл)
result.append(i)
return result