FunkyBot/cogs/coder.py

50 lines
2 KiB
Python
Raw Normal View History

2025-06-16 08:06:06 +00:00
import discord
from discord import app_commands
from discord.ext import commands
from libs.Cog import Cog
from libs.Role import Role
class Coder(Cog):
def __init__(self, bot):
super().__init__(bot)
self.messages_deletable = True
self.role = Role()
@app_commands.command(
name="coder",
description="removes the Matrix-Refuser Penguins role if you have it, and adds the Matrix Penguins role"
)
async def coder(self, interaction: discord.Interaction):
await self.role.add_role(interaction, "Matrix Penguins")
await self.role.remove_role(interaction, "Matrix-Refuser Penguins")
await interaction.response.send_message("You are now a Matrix Penguin", ephemeral=True)
@app_commands.command(
name="nocoder",
description="removes the Matrix Penguins role from your status"
)
async def nocoder(self, interaction: discord.Interaction):
await self.role.remove_role(interaction, "Matrix Penguins")
await interaction.response.send_message("You are no longer a Matrix Penguin", ephemeral=True)
@app_commands.command(
name="refuse",
description="removes the Matrix Penguins role if you have it, and adds the Matrix-Refuser Penguins role"
)
async def refuse(self, interaction: discord.Interaction):
await self.role.add_role(interaction, "Matrix-Refuser Penguins")
await self.role.remove_role(interaction, "Matrix Penguins")
await interaction.response.send_message("You are now a Matrix-Refuser Penguin", ephemeral=True)
@app_commands.command(
name="norefuse",
description="removes the Matrix-Refuser Penguins role from your status"
)
async def norefuse(self, interaction: discord.Interaction):
await self.role.remove_role(interaction, "Matrix-Refuser Penguins")
await interaction.response.send_message("You are no longer a Matrix-Refuser Penguin", ephemeral=True)
async def setup(bot):
await bot.add_cog(Coder(bot), guilds=[discord.Object(id=bot.guild_id)])