pull/115/head
stijndcl 2022-06-16 00:34:27 +02:00
parent 3d1aabf77c
commit a1449a4c9c
2 changed files with 3 additions and 18 deletions

View File

@ -1,7 +1,6 @@
import os import os
import sys import sys
import traceback import traceback
from typing import Union, Optional
import discord import discord
from discord.ext import commands from discord.ext import commands
@ -15,7 +14,7 @@ from didier.utils.prefix import get_prefix
class Didier(commands.Bot): class Didier(commands.Bot):
"""DIDIER <3""" """DIDIER <3"""
initial_extensions: tuple[str] = () initial_extensions: tuple[str, ...] = ()
def __init__(self): def __init__(self):
activity = discord.Activity(type=discord.ActivityType.playing, name=settings.DISCORD_STATUS_MESSAGE) activity = discord.Activity(type=discord.ActivityType.playing, name=settings.DISCORD_STATUS_MESSAGE)
@ -75,21 +74,6 @@ class Didier(commands.Bot):
elif os.path.isdir(new_path := f"{path}/{file}"): elif os.path.isdir(new_path := f"{path}/{file}"):
await self._load_directory_extensions(new_path) await self._load_directory_extensions(new_path)
async def respond(
self,
context: Union[commands.Context, discord.Interaction],
message: str,
mention_author: bool = False,
ephemeral: bool = True,
embeds: Optional[list[discord.Embed]] = None,
):
"""Function to respond to both a normal message and an interaction"""
if isinstance(context, commands.Context):
return await context.reply(message, mention_author=mention_author, embeds=embeds)
if isinstance(context, discord.Interaction):
return await context.response.send_message(message, ephemeral=ephemeral, embeds=embeds)
async def resolve_message(self, reference: discord.MessageReference) -> discord.Message: async def resolve_message(self, reference: discord.MessageReference) -> discord.Message:
"""Fetch a message from a reference""" """Fetch a message from a reference"""
# Message is in the cache, return it # Message is in the cache, return it

View File

@ -9,7 +9,8 @@ plugins = [
[tool.pylint.master] [tool.pylint.master]
disable = [ disable = [
"missing-module-docstring", "missing-module-docstring",
"too-few-public-methods" "too-few-public-methods",
"too-many-arguments"
] ]
[tool.pylint.format] [tool.pylint.format]