ExampleBot/main.py
mctaylors 25da14d692
Initial commit
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
2024-11-05 23:16:12 +03:00

19 lines
No EOL
521 B
Python

import aiohttp
import asyncio
import client
import os
from next.ext.commands import DefaultHelpCommand
async def main():
async with aiohttp.ClientSession() as session:
token = os.getenv("BOT_TOKEN")
if token is None :
print("Environment variable BOT_TOKEN is not set. Exiting.")
exit(1)
c = client.Client(session, token)
c.help_command = DefaultHelpCommand("Available commands")
print("Starting client...")
await c.start()
asyncio.run(main())