updated pylint

This commit is contained in:
SeaswimmerTheFsh 2023-06-19 17:11:20 -04:00
parent 247c94852f
commit 83637385fe
2 changed files with 8 additions and 1 deletions

View file

@ -22,4 +22,6 @@ jobs:
pip install python-dotenv pip install python-dotenv
- name: Analysing the code with pylint - name: Analysing the code with pylint
run: | run: |
pylint OPTIONS --generate-rcfile > .pylintrc
pylint OPTIONS --disable=C0114
pylint $(git ls-files '*.py') pylint $(git ls-files '*.py')

View file

@ -1,3 +1,4 @@
# Imports
import asyncio import asyncio
import os import os
from dotenv import load_dotenv from dotenv import load_dotenv
@ -11,15 +12,18 @@ api_url = os.getenv('API_URL')
prefix = os.getenv('PREFIX') prefix = os.getenv('PREFIX')
class Client(commands.CommandsClient): class Client(commands.CommandsClient):
# This class contains all of the commands the bot uses.
async def get_prefix(self, message: revolt.Message): async def get_prefix(self, message: revolt.Message):
return prefix return prefix
@commands.command() @commands.command()
async def ping(self, ctx: commands.Context): async def ping(self, ctx: commands.Context):
# Checks if the bot is running.
await ctx.send("Pong!") await ctx.send("Pong!")
@commands.command() @commands.command()
async def avatar(self, ctx: commands.Context, member: revolt.Member): async def avatar(self, ctx: commands.Context, member: revolt.Member):
# Checks a user's avatar.
if not isinstance(member, revolt.Member): if not isinstance(member, revolt.Member):
await ctx.send("Please provide a member argument!") await ctx.send("Please provide a member argument!")
return return
@ -27,6 +31,7 @@ class Client(commands.CommandsClient):
await ctx.send(f"{avatar}") await ctx.send(f"{avatar}")
async def main(): async def main():
# This function logs into the bot user.
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
client = Client(session, token, api_url=api_url) client = Client(session, token, api_url=api_url)
await client.start() await client.start()