added embed custom class (thanks MysticMia)

This commit is contained in:
SeaswimmerTheFsh 2023-06-21 17:03:29 -04:00
parent 5a514f86f6
commit 6a28033d52
4 changed files with 80 additions and 1 deletions

View file

@ -36,6 +36,17 @@ class Moderation(commands.Cog):
database.close()
print(f"MySQL Row Inserted!\n{moderation_id}, {moderation_type}, {target_id}, {duration}, {reason}, 0")
def add_field(self, name = None, value = None):
if name is None and value is None:
raise ValueError("A 'name' or 'value' must be given")
self.description = "\n" if self.description else ""
if value is None:
self.description += f"### {name}"
elif name is None:
self.description += f"{value}"
else:
self.description += f"### {name}\n{value}"
@commands.command(name="timeout", aliases=["mute"])
async def timeout(self, ctx: commands.Context, target: commands.MemberConverter, duration: str, *, reason: str):
try: