mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
🐛 fix(channelSetup.py): fix parameter names in premium command to improve clarity and consistency
✨ feat(channelSetup.py): add optional parameters to premium command to allow setting premium status and expiration date for a specific guild
This commit is contained in:
@@ -233,14 +233,14 @@ class ChannelSetup(commands.Cog):
|
|||||||
await ctx.respond(f"Set API key for {api} to `secret`.", ephemeral=True)
|
await ctx.respond(f"Set API key for {api} to `secret`.", ephemeral=True)
|
||||||
|
|
||||||
@setup.command(name="premium", description="Set the guild to premium.")
|
@setup.command(name="premium", description="Set the guild to premium.")
|
||||||
async def premium(self, ctx: discord.ApplicationContext):
|
async def premium(self, ctx: discord.ApplicationContext, guild_id: int = None, days: int = 180):
|
||||||
guild = Guild(ctx.guild.id)
|
guild = Guild(guild_id or ctx.guild.id)
|
||||||
guild.load()
|
guild.load()
|
||||||
if await self.bot.is_owner(ctx.author):
|
if await self.bot.is_owner(ctx.author):
|
||||||
guild.premium = True
|
guild.premium = True
|
||||||
# also set expiry date in 6 months isofromat
|
# also set expiry date in 6 months isofromat
|
||||||
guild.premium_expiration = datetime.datetime.now() + datetime.timedelta(
|
guild.premium_expiration = datetime.datetime.now() + datetime.timedelta(
|
||||||
days=180
|
days=days
|
||||||
)
|
)
|
||||||
guild.updateDbData()
|
guild.updateDbData()
|
||||||
return await ctx.respond("Set guild to premium.", ephemeral=True)
|
return await ctx.respond("Set guild to premium.", ephemeral=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user