first commit
This commit is contained in:
commit
988afb33e3
73 changed files with 8407 additions and 0 deletions
16
examples/basic.py
Normal file
16
examples/basic.py
Normal 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
22
examples/commands.py
Normal 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())
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue