From 2b84f05eacee298930ba1e9eb7066227a51ea2f6 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Sun, 24 Sep 2023 20:36:48 -0400 Subject: [PATCH] fix(podcast): pylint fixes --- podcast/podcast.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/podcast/podcast.py b/podcast/podcast.py index 5e61762..b110ef7 100644 --- a/podcast/podcast.py +++ b/podcast/podcast.py @@ -1,7 +1,4 @@ -import discord -from datetime import datetime -from redbot.core.bot import Red -from redbot.core import commands, checks, Config, bot +from redbot.core import commands, checks, Config class Podcast(commands.Cog): """Provides a questions submission system for podcasts. @@ -21,20 +18,19 @@ class Podcast(commands.Cog): ) @commands.command() - async def podcast(self, ctx, question: str): + async def podcast(self, ctx: commands.Context, question: str): """Submits a question to the Podcast.""" prefix = await self.bot.get_valid_prefixes() if await self.config.guild(ctx.guild).global_mode(True): - submission_channel = bot.get_channel(await self.config.global_submission_channel()) + submission_channel = ctx.bot.get_channel(await self.config.global_submission_channel()) blacklisted_users = await self.config.global_blacklisted_users() elif await self.config.guild(ctx.guild).global_mode(False): - submission_channel = bot.get_channel(await self.config.guild(ctx.guild).submission_channel()) + submission_channel = ctx.bot.get_channel(await self.config.guild(ctx.guild).submission_channel()) blacklisted_users = await self.config.guild(ctx.guild).blacklisted_users() else: return if ctx.author.id in blacklisted_users: await ctx.author.send(content=f"You are blacklisted from ``{prefix}podcast``!") - return else: await submission_channel.send(content=f"{question}") await ctx.send(content="Question submitted!") @@ -48,11 +44,11 @@ class Podcast(commands.Cog): @podcastset.command(name="global") async def set_global_mode(self, ctx, enabled: bool): """Enables or disables global mode.""" - if enabled == True: + if enabled is True: await self.config.guild(ctx.guild).global_mode.set(True) await ctx.send(content="``global_mode`` has been enabled.") - elif enabled == False: + elif enabled is False: await self.config.guild(ctx.guild).global_mode.set(False) await ctx.send(content="``global_mode`` has been disabled.") else: - await ctx.send(content="Please specify an argument!") \ No newline at end of file + await ctx.send(content="Please specify an argument!")