fix(podcast): pylint fixes
This commit is contained in:
parent
62a354b8c7
commit
2b84f05eac
1 changed files with 7 additions and 11 deletions
|
@ -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!")
|
||||
await ctx.send(content="Please specify an argument!")
|
||||
|
|
Loading…
Reference in a new issue