your_list = list(map(int, your_list))
if self.obj.peer_id < 0:. Вам приходит NoneType, т.е пустой объект, который не может быть сравнен оператором
TypeError: '<' not supported between instances of 'NoneType' and 'int'
msg = []
while True:
try:
for event in longpoll.listen():
if event.type == VkEventType.MESSAGE_NEW:
text = event.text.lower()
answer = text.split()
if event.from_chat:
if (len(answer) == 3) and (answer[0] == "!удалить"):
id = int(answer[1])
count = int(answer[2])
h = vk.method("messages.getHistory", {"peer_id": event.peer_id, "count": 30, "offset": 0})
for ids in h["items"]:
if ids["from_id"] == id:
msg.append(ids.get('id'))
except Exception as e:
print(e)