Name | bonk-bot JSON |
Version |
2.0.4
JSON |
| download |
home_page | None |
Summary | Python API wrapper for bonk.io web game. |
upload_time | 2024-08-04 11:48:25 |
maintainer | Safizapi |
docs_url | None |
author | Safizapi |
requires_python | >=3.8 |
license | MIT License Copyright (c) 2024 Safizapi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
bonk
bonk.io
bots
api
bonk-bot
|
VCS |
|
bugtrack_url |
|
requirements |
python-engineio
python-socketio
aiohttp
requests
nest-asyncio
pymitter
lzstring
setuptools
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# bonk_bot
User-friendly async python framework for writing bots in bonk.io.
Supported python versions: 3.8+
## Features
- API is using async and await for handling several connections and requests at once
- Different bonk.io servers support
- Event-based (discord.py-like events)
## Installing
**Python 3.8 and higher required**
Go to your project's terminal and run the following command:
```
pip install bonk_bot
```
## Bot example
```py
import asyncio
from bonk_bot import bonk_guest_login, Game, Message
bot = bonk_guest_login("Safizapi")
bot.main_avatar = bot.avatars[1]
@bot.event
async def on_game_connect(game: Game):
print(f"Connected game {game.room_name}")
print(game.join_link)
@bot.event
async def on_error(error):
print(error)
@bot.event
async def on_message(message: Message):
if not message.author.is_bot and message.content == "!ping":
await message.game.send_message("Pong!")
@bot.event
async def on_game_disconnect(game: Game):
print(f"Disconnected from game {game.room_name}")
async def main():
await bot.create_game(name="Cool room", max_players=4)
await bot.run()
asyncio.run(main())
```
## Documentation
Coming soon
Raw data
{
"_id": null,
"home_page": null,
"name": "bonk-bot",
"maintainer": "Safizapi",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "bonk, bonk.io, bots, api, bonk-bot",
"author": "Safizapi",
"author_email": null,
"download_url": null,
"platform": null,
"description": "# bonk_bot\r\nUser-friendly async python framework for writing bots in bonk.io.\r\nSupported python versions: 3.8+\r\n## Features\r\n- API is using async and await for handling several connections and requests at once\r\n- Different bonk.io servers support\r\n- Event-based (discord.py-like events)\r\n## Installing\r\n**Python 3.8 and higher required**\r\n\r\nGo to your project's terminal and run the following command:\r\n```\r\npip install bonk_bot\r\n```\r\n## Bot example\r\n\r\n```py\r\nimport asyncio\r\n\r\nfrom bonk_bot import bonk_guest_login, Game, Message\r\n\r\nbot = bonk_guest_login(\"Safizapi\")\r\nbot.main_avatar = bot.avatars[1]\r\n\r\n\r\n@bot.event\r\nasync def on_game_connect(game: Game):\r\n print(f\"Connected game {game.room_name}\")\r\n print(game.join_link)\r\n\r\n\r\n@bot.event\r\nasync def on_error(error):\r\n print(error)\r\n\r\n\r\n@bot.event\r\nasync def on_message(message: Message):\r\n if not message.author.is_bot and message.content == \"!ping\":\r\n await message.game.send_message(\"Pong!\")\r\n\r\n\r\n@bot.event\r\nasync def on_game_disconnect(game: Game):\r\n print(f\"Disconnected from game {game.room_name}\")\r\n\r\n\r\nasync def main():\r\n await bot.create_game(name=\"Cool room\", max_players=4)\r\n\r\n await bot.run()\r\n\r\n\r\nasyncio.run(main())\r\n```\r\n## Documentation\r\nComing soon\r\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Safizapi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Python API wrapper for bonk.io web game.",
"version": "2.0.4",
"project_urls": {
"Repository": "https://github.com/Safizapi/bonk_bot"
},
"split_keywords": [
"bonk",
" bonk.io",
" bots",
" api",
" bonk-bot"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "36fbfa5cc6c5acca6e645d0a53aa246e9bed22effe72e033dee7311658a6a3a0",
"md5": "acf3de8d37a85ff6d7c956279b4d05cf",
"sha256": "e94a6b6f85d18dfe3ba5565c09a7cb27a227c9f32b94955f368c73699fbdfc58"
},
"downloads": -1,
"filename": "bonk_bot-2.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "acf3de8d37a85ff6d7c956279b4d05cf",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 34652,
"upload_time": "2024-08-04T11:48:25",
"upload_time_iso_8601": "2024-08-04T11:48:25.868314Z",
"url": "https://files.pythonhosted.org/packages/36/fb/fa5cc6c5acca6e645d0a53aa246e9bed22effe72e033dee7311658a6a3a0/bonk_bot-2.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-04 11:48:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Safizapi",
"github_project": "bonk_bot",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "python-engineio",
"specs": [
[
"==",
"3.14.2"
]
]
},
{
"name": "python-socketio",
"specs": [
[
"==",
"4.6.0"
]
]
},
{
"name": "aiohttp",
"specs": [
[
"==",
"3.9.5"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "nest-asyncio",
"specs": [
[
"==",
"1.6.0"
]
]
},
{
"name": "pymitter",
"specs": [
[
"==",
"0.5.1"
]
]
},
{
"name": "lzstring",
"specs": [
[
"==",
"1.0.4"
]
]
},
{
"name": "setuptools",
"specs": [
[
"==",
"70.1.0"
]
]
}
],
"lcname": "bonk-bot"
}