API wrapper for https://api.econuker.xyz
Project description
EcoNuker
EcoNuker is a Python library for interacting with the EcoNuker API, which provides routes for items, servers, and more!
Installation
You can install the EcoNuker-API library using pip:
pip install econuker
Usage
WARNING: The MAIN API is not available for use until June 1, 2023.
Please use the BETA version. Beta=True.
Example
# Python Example
from econuker import Client
beta = True # False
authtoken = None # "your auth token here"
if __name__ == "__main__":
client = Client(auth_token=authtoken, beta=beta)
status = client.status()
print(status.name)
Async Example
# Python Async Example
from econuker import AsyncClient
beta = True # False
authtoken = None # "your auth token here"
if __name__ == "__main__":
client = AsyncClient(auth_token=authtoken, beta=beta)
async def asyncfunction():
status = await client.status()
print(status.name)
return status
asyncio.run(asyncfunction())
Downtime Notifier Example
# Python Downtime Notifier Example
import econuker
from econuker import AsyncClient
beta = True # get notified about downtime of our Beta bot.
authtoken = None
down = False
import guilded # pip install guilded.py
import asyncio
client = guilded.Client()
channelid = "" # the channel you want downtime notifications to be sent to! Make sure your bot has permissions.
async def monitorbot(client:AsyncClient):
global down
bot_name = await client.status().name
while True:
check = await client.ping()
if not check:
if not down:
channel = await bot.fetch_channel(channelid)
await channel.send(f'{bot_name} is down!')
down = True
if check and down:
down = False
channel = await bot.fetch_channel(channelid)
await channel.send(f'{bot_name} is online!')
await asyncio.sleep(10)
@bot.event
async def on_ready():
print(f'Ready! Logged in as {bot.user.name}')
try:
client
except:
client = AsyncClient(beta=beta, auth_token=authtoken)
bot.loop.create_task(monitorbot(client))
bot.run('guilded bot token here')
Documentation For detailed documentation on the EcoNuker API, read https://docs.econuker.xyz/
For detailed documentation on how to use the EcoNuker-API library, please wait while we write it lol.
License This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file econuker-1.0.7.tar.gz
.
File metadata
- Download URL: econuker-1.0.7.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16a4fcaf387b9ab522779aacc81fbedc6c061d91e01b4f482ff21db6e6014281 |
|
MD5 | 179ba707fb16378bfe5988b10b17da42 |
|
BLAKE2b-256 | 7bbf04aff88fe598bb154273d139b0391cac2d78b2ae080d0a0f3d2bd437ebab |
File details
Details for the file econuker-1.0.7-py3-none-any.whl
.
File metadata
- Download URL: econuker-1.0.7-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 072e0e2acf0227e5364240e1f2117f22c136e813caa0c82495ff0e45d5792c65 |
|
MD5 | bcbf2ff705bb1c9818da28ea9c0e26e7 |
|
BLAKE2b-256 | 1c398b3cbadd304ed90487549869583aedd50427d59127b8bd73bfadb7ef85ae |