1
Fork 0
mirror of https://github.com/allthingslinux/tux.git synced 2024-10-02 16:43:12 +00:00
tux/.archive/mod.py
kzndotsh ef441a7e12 feat: add new mod.py and voice.py files in .archive directory for logging moderation and voice activities
refactor: move mod.py from tux/cogs/logging to .archive directory to improve project structure
2024-05-01 06:18:14 +00:00

119 lines
3.5 KiB
Python

import discord
from discord.ext import commands
from tux.utils.constants import Constants as CONST
# from tux.utils.embeds import EmbedCreator
class ModLogging(commands.Cog):
def __init__(self, bot: commands.Bot):
self.bot = bot
self.mod_log_channel_id: int = CONST.LOG_CHANNELS["MOD"]
async def send_to_mod_log(self, embed: discord.Embed):
channel = self.bot.get_channel(self.mod_log_channel_id)
if isinstance(channel, discord.TextChannel):
await channel.send(embed=embed)
# @commands.Cog.listener()
# async def on_member_ban(self, guild: discord.Guild, user: discord.User):
# embed = EmbedCreator.create_log_embed(
# title="Member Banned",
# description=f"{user.mention} has been banned.",
# )
# embed.add_field(name="User", value=user.name)
# embed.add_field(name="ID", value=f"`{user.id}`")
# embed.set_thumbnail(url=user.display_avatar)
# await self.send_to_mod_log(embed)
# @commands.Cog.listener()
# async def on_member_unban(self, guild: discord.Guild, user: discord.User):
# embed = EmbedCreator.create_log_embed(
# title="Member Unbanned",
# description=f"User: {user.name}",
# )
# await self.send_to_mod_log(embed)
# @commands.Cog.listener()
# async def on_automod_rule_create(self, rule: discord.AutoModRule) -> None:
# """
# When an automod rule is created
# Parameters
# ----------
# rule : discord.AutoModRule
# The rule that was created.
# """
# embed = EmbedCreator.create_log_embed(
# title="Automod Rule Created",
# description=f"Rule: {rule.name}",
# )
# await self.send_to_mod_log(embed)
# @commands.Cog.listener()
# async def on_automod_rule_update(self, rule: discord.AutoModRule) -> None:
# """
# When an automod rule is updated
# Parameters
# ----------
# rule : discord.AutoModRule
# The rule that was updated.
# """
# embed = EmbedCreator.create_log_embed(
# title="Automod Rule Updated",
# description=f"Rule: {rule.name}",
# )
# await self.send_to_mod_log(embed)
# @commands.Cog.listener()
# async def on_automod_rule_delete(self, rule: discord.AutoModRule) -> None:
# """
# When an automod rule is deleted
# Parameters
# ----------
# rule : discord.AutoModRule
# The rule that was deleted.
# """
# embed = EmbedCreator.create_log_embed(
# title="Automod Rule Deleted",
# description=f"Rule: {rule.name}",
# )
# await self.send_to_mod_log(embed)
# @commands.Cog.listener()
# async def on_reaction_clear(
# self, message: discord.Message, reactions: list[discord.Reaction]
# ) -> None:
# """
# When reactions are cleared from a message
# Parameters
# ----------
# message : discord.Message
# The message that had reactions cleared.
# reactions : list[discord.Reaction]
# The reactions that were cleared.
# """
# embed = EmbedCreator.create_log_embed(
# title="Reactions cleared for",
# description=f"Message: {message.jump_url}",
# )
# await self.send_to_mod_log(embed)
async def setup(bot: commands.Bot) -> None:
await bot.add_cog(ModLogging(bot))