2023-06-17 16:20:30 +02:00

26 lines
648 B
Python

import discord
ENCODING = "utf-8"
class BaseModule:
_client = None
def __init__(self, client):
self._client = client
def load(self):
raise NotImplementedError
async def handle_message(self, message):
raise NotImplementedError
async def get_channel_name(self, channel) -> str:
if isinstance(channel, discord.DMChannel):
dm_channel = await self._client.fetch_channel(channel.id)
return "[DM={0}]".format(dm_channel.recipient.name)
else:
return "[Server={0}] => [Channel={1}]".format(
channel.guild.name, channel.name
)