first commit

This commit is contained in:
Avanpost 2024-11-05 14:57:38 +00:00
commit 988afb33e3
Signed by: avanpost20
GPG key ID: C879DD866453B55E
73 changed files with 8407 additions and 0 deletions

16
examples/basic.py Normal file
View file

@ -0,0 +1,16 @@
import asyncio
import aiohttp
import next
class Client(next.Client):
async def on_message(self, message: next.Message):
if message.content == "hello":
await message.channel.send("hi how are you")
async def main():
async with aiohttp.ClientSession() as session:
client = Client(session, "BOT TOKEN HERE")
await client.start()
asyncio.run(main())

22
examples/commands.py Normal file
View file

@ -0,0 +1,22 @@
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())