next.py/examples/commands.py

23 lines
465 B
Python
Raw Normal View History

2024-11-05 14:57:38 +00:00
import asyncio
import aiohttp
import next
from next.ext import commands
class Client(commands.CommandsClient):
async def get_prefix(self, message: next.Message):
return "!"
@commands.command()
async def ping(self, ctx: commands.Context):
await ctx.send("pong")
async def main():
async with aiohttp.ClientSession() as session:
client = Client(session, "BOT TOKEN HERE")
await client.start()
asyncio.run(main())