rnovatorov / async-vk-bot Goto Github PK
View Code? Open in Web Editor NEWAsync VK bot builder built with trio and async-vk-api.
Async VK bot builder built with trio and async-vk-api.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:/Users/chron/PycharmProjects/canadatalks/bot.py", line 53, in <module>
trio.run(main)
File "C:\Users\chron\PycharmProjects\canadatalks\venv\lib\site-packages\trio\_core\_run.py", line 1337, in run
raise runner.main_task_outcome.error
File "C:/Users/chron/PycharmProjects/canadatalks/bot.py", line 49, in main
nursery.start_soon(prfmsg, bot)
File "C:\Users\chron\PycharmProjects\canadatalks\venv\lib\site-packages\trio\_core\_run.py", line 398, in __aexit__
raise combined_error_from_nursery
File "C:/Users/chron/PycharmProjects/canadatalks/bot.py", line 33, in prfmsg
type='typing'
File "C:\Users\chron\PycharmProjects\canadatalks\venv\lib\site-packages\async_vk_api\api.py", line 75, in __call__
return await self.group.api(self.full_name, **params)
File "C:\Users\chron\PycharmProjects\canadatalks\venv\lib\site-packages\async_vk_api\api.py", line 40, in __call__
params=params
File "C:\Users\chron\PycharmProjects\canadatalks\venv\lib\site-packages\asks\sessions.py", line 211, in request
await self._handle_exception(e, sock)
File "C:\Users\chron\PycharmProjects\canadatalks\venv\lib\site-packages\asks\sessions.py", line 249, in _handle_exception
raise BadHttpResponse('Invalid HTTP response from server.') from e
asks.errors.BadHttpResponse: Invalid HTTP response from server.
Process finished with exit code 1```
Perform message function:
```async def prfmsg(bot):
async with bot.sub(new_message) as events:
async for event in events:
await bot.api.messages.setActivity(
peer_id=event['object']['peer_id'],
type='typing'
)
msg = await perform(event['object']['peer_id'], event['object']['text'])
await bot.api.messages.send(
peer_id=event['object']['peer_id'],
message=msg
)```
Very random cases after ~3 min of running
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.