Add DataManager and Logging cogs; enhance existing features
- Updated `.gitignore` to include `cython_debug/`. - Introduced `DataManager` class for data retention policies. - Added logging functionality for server events in `logging.py`. - Refactored `hiring.py` and improved order submission in `kofishop.py`. - Added new cogs: `MORS`, `ServiceReview`, and `StaffMsg`. - Updated `info.json` for new cogs and modified `__init__.py` files for setup.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import discord
|
||||
from redbot.core import commands, Config
|
||||
from redbot.core.bot import Red
|
||||
from redbot.core.bot import Red
|
||||
from typing import Optional
|
||||
|
||||
# --- Modals for the Commands ---
|
||||
@@ -18,11 +18,11 @@ class OrderModal(discord.ui.Modal, title="Commission/Shop Order"):
|
||||
async def on_submit(self, interaction: discord.Interaction):
|
||||
if not interaction.guild:
|
||||
return await interaction.response.send_message("This must be used in a server.", ephemeral=True)
|
||||
|
||||
|
||||
order_channel_id = await self.cog.config.guild(interaction.guild).order_channel()
|
||||
if not order_channel_id:
|
||||
return await interaction.response.send_message("The order channel has not been set by an admin.", ephemeral=True)
|
||||
|
||||
|
||||
order_channel = interaction.guild.get_channel(order_channel_id)
|
||||
if not isinstance(order_channel, discord.TextChannel):
|
||||
return await interaction.response.send_message("The configured order channel is invalid.", ephemeral=True)
|
||||
@@ -121,15 +121,15 @@ class KofiShop(commands.Cog):
|
||||
"""Add a user and their requested item to the waitlist."""
|
||||
if not ctx.guild or not isinstance(ctx.channel, discord.TextChannel):
|
||||
return await ctx.send("This command must be used in a server's text channel.", ephemeral=True)
|
||||
|
||||
|
||||
waitlist_channel_id = await self.config.guild(ctx.guild).waitlist_channel()
|
||||
if not waitlist_channel_id:
|
||||
return await ctx.send("The waitlist channel has not been set by an admin.", ephemeral=True)
|
||||
|
||||
|
||||
waitlist_channel = ctx.guild.get_channel(waitlist_channel_id)
|
||||
if not isinstance(waitlist_channel, discord.TextChannel):
|
||||
return await ctx.send("The configured waitlist channel is invalid.", ephemeral=True)
|
||||
|
||||
|
||||
message = f"**{item}** ིྀ {user.mention} ✧ in {ctx.channel.mention}"
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user