async def main():
async with aiovk.TokenSession(access_token=TOKEN()) as session:
api = API(session)
longpoll = BotsLongPoll(session, mode=8, group_id=VK_GROUP_ID())
while True:
try:
data = await longpoll.wait()
updates = data['updates']
for event in updates:
if event['type'] == 'message_new':
if event['object']['message']['text'].lower() == 'qqq':
await api("messages.send",
peer_id=event['object']['message']['peer_id'],
random_id=0,
message="q")
except:
pass
2.pip install app