ekonda / sketal

Бот для ВКонтакте. Беседы / группы / развлечения.
MIT License
119 stars 64 forks source link

Неконектится #82

Closed miztizm closed 6 years ago

miztizm commented 6 years ago

C токеном:

python bot.py
bot.py     [18.02.14 13:45:22] INFO    : Initializing bot
bot.py     [18.02.14 13:45:22] INFO    : Initializing vk clients
bot.py     [18.02.14 13:45:22] INFO    : Loading plugins
sayer.py   [18.02.14 13:45:22] WARNING : You are using public key for Speechkit Cloud! Get your own: https://tech.yandex.ru/speechkit/cloud/
bot.py     [18.02.14 13:45:22] INFO    : Bot successfully initialized
bot.py     [18.02.14 13:45:22] INFO    : Started to process messages
api.py     [18.02.14 13:45:23] WARNING : Can't execute code: "return [API.messages.getLongPollServer({ "use_ssl":1,"lp_version":2})];"
api.py     [18.02.14 13:45:24] WARNING : Can't execute code: "return [API.messages.getLongPollServer({ "use_ssl":1,"lp_version":2})];"
api.py     [18.02.14 13:45:25] WARNING : Can't execute code: "return [API.messages.getLongPollServer({ "use_ssl":1,"lp_version":2})];"
api.py     [18.02.14 13:45:27] WARNING : Can't execute code: "return [API.messages.getLongPollServer({ "use_ssl":1,"lp_version":2})];"

С логином и паролем:

 python bot.py
bot.py     [18.02.14 13:49:13] INFO    : Initializing bot
bot.py     [18.02.14 13:49:13] INFO    : Initializing vk clients
Traceback (most recent call last):
  File "bot.py", line 397, in <module>
    bot = Bot(BotSettings)
  File "bot.py", line 42, in __init__
    self.api = VkController(settings, logger=self.logger)
  File "/var/www/app/bot/vk/plus.py", line 55, in __init__
    loop.run_until_complete(self.init_vk())
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 467, in run_until_complete
    return future.result()
  File "/var/www/app/bot/vk/plus.py", line 87, in init_vk
    await client.user(user[1], user[2], self.app_id, self.scope)
  File "/var/www/app/bot/vk/api.py", line 209, in user
    self.token = await self.auth.get_token(username, password, app_id, scope)
  File "/var/www/app/bot/vk/auth.py", line 116, in get_token
    with aiohttp.ClientSession() as session:
  File "/usr/local/lib/python3.6/site-packages/aiohttp/client.py", line 742, in __enter__
    raise TypeError("Use async with instead")
TypeError: Use async with instead
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x80a707128>
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x80a7072e8>
astrdark commented 6 years ago

Ты правильный access_token написал? откуда?

miztizm commented 6 years ago

Ты прав ступил, насчет токена группы; юзал старый токен с новым прошло все успешно Скачал также последнии апдейты что ты запушил.

Группа:

 python bot.py
bot.py     [18.02.14 14:36:09] INFO    : Initializing bot
bot.py     [18.02.14 14:36:10] INFO    : Initializing vk clients
api.py     [18.02.14 14:36:10] INFO    : Logged in as: XXXXX (https://vk.com/xxxxx)
bot.py     [18.02.14 14:36:10] INFO    : Loading plugins
sayer.py   [18.02.14 14:36:10] WARNING : You are using public key for Speechkit Cloud! Get your own: https://tech.yandex.ru/speechkit/cloud/
bot.py     [18.02.14 14:36:10] INFO    : Bot successfully initialized
bot.py     [18.02.14 14:36:10] INFO    : Started to process messages

Пользователь (запрос делал на VK API программу): Сгенерировал новый токен пользователа с помощью:

https://oauth.vk.com/authorize?client_id=3116505&scope=friends,photos,audio,video,docs,notes,pages,status,offers,questions,wall,groups,messages,notifications,stats,ads,market,offline&redirect_uri=https://api.vk.com/blank.html&display=page&response_type=token

и тоже все сработало:)

Пользователь с логином: Ввелл мыло и пасс и тоже заработало:)

 python bot.py
bot.py     [18.02.14 14:44:34] INFO    : Initializing bot
bot.py     [18.02.14 14:44:34] INFO    : Initializing vk clients
api.py     [18.02.14 14:44:36] INFO    : Logged in as: XXXXX (https://vk.com/XXXX)
bot.py     [18.02.14 14:44:36] INFO    : Loading plugins
sayer.py   [18.02.14 14:44:36] WARNING : You are using public key for Speechkit Cloud! Get your own: https://tech.yandex.ru/speechkit/cloud/
bot.py     [18.02.14 14:44:36] INFO    : Bot successfully initialized
bot.py     [18.02.14 14:44:36] INFO    : Started to process messages

За что отвечает строка SCOPE?

Спасибо большое за подсказки, будут траблы напишу) Здорово!:)

astrdark commented 6 years ago

@devcline SCOPE - Права доступа