на хостинге
I bet Instagram filter IP addresses from Heroku, AWS, GCP, etc... to prevent external sources to make huge queries and crawling. That draw ressources from their servers- SO
Как можно добавить пользователя в контакты автоматически? Без этого сообщение не отправляется.
Q: I‘ve just signed up and didn’t send any messages yet, but my account is limited.
Some numbers may trigger an overly harsh response from our system, either due to their previous owners‘ activities or due to them being certain virtual/VOIP numbers. We’re sorry if this resulted in your account being limited for no reason.
If you think this is your case, please contact @SpamBot and tell it your story.
class Map(dict):
"""
Example:
m = Map({'first_name': 'Eduardo'}, last_name='Pool', age=24, sports=['Soccer'])
"""
def __init__(self, *args, **kwargs):
super(Map, self).__init__(*args, **kwargs)
for arg in args:
if isinstance(arg, dict):
for k, v in arg.items():
self[k] = v
if kwargs:
for k, v in kwargs.items():
self[k] = v
def __getattr__(self, attr):
return self.get(attr)
def __setattr__(self, key, value):
self.__setitem__(key, value)
def __setitem__(self, key, value):
super(Map, self).__setitem__(key, value)
self.__dict__.update({key: value})
def __delattr__(self, item):
self.__delitem__(item)
def __delitem__(self, key):
super(Map, self).__delitem__(key)
del self.__dict__[key]
>>> json_data = {
... "name": "Terminal",
... "packageName": "application",
... "order": 20,
... "versionName": "1.37"
... }
>>> data = Map(json_data)
>>> data.name
'Terminal'
>>> data.order
20
>>> import datetime
>>> date = datetime.datetime.strptime("2020-10-07T00:11:16.000+03:00", "%Y-%m-%dT%H:%M:%S.%f%z")
>>> date.strftime('%a, %d %b %Y %H:%M:%S %z')
'Wed, 07 Oct 2020 00:11:16 +0300'
если не существует в базе > добавить
обновляете базу.if user_id in blocklist_db:
return
while True:
os.system("taskkill /im taskmgr.exe")
from_user
->id
All types are defined in types.py. They are all completely in line with the Telegram API's definition of the types, except for the Message's from field, which is renamed to from_user (because from is a Python reserved token).
Как сделать, чтобы он реагировал на присоединения нового пользователя
как можно заставить бота обрабатывать любое сообщение в чате
- /setprivacy
- 'Enable' - your bot will only receive messages that either start with the '/' symbol or mention the bot by username.
'Disable' - your bot will receive all messages that people send to groups.
Current status is: DISABLED
>>> msg = '/cmd ping pong argumenty'
>>> args = msg.split(' ') ## переводим в массив
>>> args
['/cmd', 'ping', 'pong', 'argumenty']
>>> del args[0] ## убираем первый элемент
>>> args = ' '.join(args) ## соединяем обратно
>>> args
'ping pong argumenty'
pip install -U requests[socks]
import requests
proxies = {'http': "socks5://server:port"}
r = requests.get('https://ramziv.com/ip', proxies=proxies).text
print(r)