committing initial files
This commit is contained in:
parent
00b756eea9
commit
c0eeeb93f5
3 changed files with 49 additions and 1 deletions
33
main.py
Normal file
33
main.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
import asyncio
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
import aiohttp
|
||||
import revolt
|
||||
from revolt.ext import commands
|
||||
|
||||
load_dotenv()
|
||||
token = os.getenv('TOKEN')
|
||||
api_url = os.getenv('API_URL')
|
||||
|
||||
class Client(commands.CommandsClient):
|
||||
async def get_prefix(self, message: revolt.Message):
|
||||
return "."
|
||||
|
||||
@commands.command()
|
||||
async def ping(self, ctx: commands.Context):
|
||||
await ctx.send("Pong!")
|
||||
|
||||
@commands.command()
|
||||
async def avatar(self, ctx: commands.Context, member: revolt.Member):
|
||||
if not isinstance(member, revolt.Member):
|
||||
await ctx.send("Please provide a member argument!")
|
||||
return
|
||||
avatar = member.avatar.url
|
||||
await ctx.send(f"{avatar}")
|
||||
|
||||
async def main():
|
||||
async with aiohttp.ClientSession() as session:
|
||||
client = Client(session, token, api_url=api_url)
|
||||
await client.start()
|
||||
|
||||
asyncio.run(main())
|
Loading…
Add table
Add a link
Reference in a new issue