🐛 fix(channelSetup.py): change guild_id parameter type from int to str to handle cases where guild_id is not an integer

 feat(channelSetup.py): convert guild_id to string if it is not provided as a parameter to handle cases where guild_id is not passed
This commit is contained in:
2023-08-21 12:34:14 +02:00
parent c236dfbb29
commit cf46727258

View File

@@ -233,8 +233,8 @@ class ChannelSetup(commands.Cog):
await ctx.respond(f"Set API key for {api} to `secret`.", ephemeral=True)
@setup.command(name="premium", description="Set the guild to premium.")
async def premium(self, ctx: discord.ApplicationContext, guild_id: int = None, days: int = 180):
guild = Guild(guild_id or ctx.guild.id)
async def premium(self, ctx: discord.ApplicationContext, guild_id: str = None, days: int = 180):
guild = Guild(guild_id or str(ctx.guild.id))
guild.load()
if await self.bot.is_owner(ctx.author):
guild.premium = True