fix(podcast): pylint fixes

This commit is contained in:
Seaswimmer 2023-09-24 20:36:48 -04:00
parent 62a354b8c7
commit 2b84f05eac
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -1,7 +1,4 @@
import discord from redbot.core import commands, checks, Config
from datetime import datetime
from redbot.core.bot import Red
from redbot.core import commands, checks, Config, bot
class Podcast(commands.Cog): class Podcast(commands.Cog):
"""Provides a questions submission system for podcasts. """Provides a questions submission system for podcasts.
@ -21,20 +18,19 @@ class Podcast(commands.Cog):
) )
@commands.command() @commands.command()
async def podcast(self, ctx, question: str): async def podcast(self, ctx: commands.Context, question: str):
"""Submits a question to the Podcast.""" """Submits a question to the Podcast."""
prefix = await self.bot.get_valid_prefixes() prefix = await self.bot.get_valid_prefixes()
if await self.config.guild(ctx.guild).global_mode(True): 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() blacklisted_users = await self.config.global_blacklisted_users()
elif await self.config.guild(ctx.guild).global_mode(False): 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() blacklisted_users = await self.config.guild(ctx.guild).blacklisted_users()
else: else:
return return
if ctx.author.id in blacklisted_users: if ctx.author.id in blacklisted_users:
await ctx.author.send(content=f"You are blacklisted from ``{prefix}podcast``!") await ctx.author.send(content=f"You are blacklisted from ``{prefix}podcast``!")
return
else: else:
await submission_channel.send(content=f"{question}") await submission_channel.send(content=f"{question}")
await ctx.send(content="Question submitted!") await ctx.send(content="Question submitted!")
@ -48,10 +44,10 @@ class Podcast(commands.Cog):
@podcastset.command(name="global") @podcastset.command(name="global")
async def set_global_mode(self, ctx, enabled: bool): async def set_global_mode(self, ctx, enabled: bool):
"""Enables or disables global mode.""" """Enables or disables global mode."""
if enabled == True: if enabled is True:
await self.config.guild(ctx.guild).global_mode.set(True) await self.config.guild(ctx.guild).global_mode.set(True)
await ctx.send(content="``global_mode`` has been enabled.") 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 self.config.guild(ctx.guild).global_mode.set(False)
await ctx.send(content="``global_mode`` has been disabled.") await ctx.send(content="``global_mode`` has been disabled.")
else: else: