Skip to content

Commit

Permalink
fix: lint error addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
camalot committed Nov 21, 2023
1 parent 28722b7 commit 93be511
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
24 changes: 18 additions & 6 deletions bot/cogs/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ async def save(self, ctx):
return

category_settings = self.settings.db.get_guild_category_settings(guildId=guild_id, categoryId=category_id)
default_role = self.settings.db.get_default_role(guildId=guild_id, categoryId=category_id, userId=owner_id)
default_role = self.settings.db.get_default_role(
guildId=guild_id, categoryId=category_id, userId=owner_id
)
temp_default_role = utils.get_by_name_or_id(ctx.guild.roles, default_role) or ctx.guild.default_role

if category_settings is None:
Expand Down Expand Up @@ -183,7 +185,9 @@ async def _name(self, ctx, name: typing.Optional[str] = None, saveSettings: bool
)
return
category_settings = self.settings.db.get_guild_category_settings(guildId=guild_id, categoryId=category_id)
default_role = self.settings.db.get_default_role(guildId=guild_id, categoryId=category_id, userId=owner_id)
default_role = self.settings.db.get_default_role(
guildId=guild_id, categoryId=category_id, userId=owner_id
)
temp_default_role = utils.get_by_name_or_id(ctx.guild.roles, default_role) or ctx.guild.default_role

if category_settings is None:
Expand Down Expand Up @@ -275,7 +279,9 @@ async def force_name(self, ctx, *, name: typing.Optional[str] = None):
if not name or name == "":
name = utils.get_random_name()
category_id = ctx.author.voice.channel.category.id
guild_category_settings = self.settings.db.get_guild_category_settings(guildId=guild_id, categoryId=category_id)
guild_category_settings = self.settings.db.get_guild_category_settings(
guildId=guild_id, categoryId=category_id
)
owner_id = self.channel_db.get_channel_owner_id(guildId=guild_id, channelId=channel_id)
if not owner_id:
await self._messaging.send_embed(
Expand All @@ -286,7 +292,9 @@ async def force_name(self, ctx, *, name: typing.Optional[str] = None):
)
return
user_settings = self.usersettings_db.get_user_settings(guildId=guild_id, userId=owner_id)
default_role = self.settings.db.get_default_role(guildId=guild_id, categoryId=category_id, userId=owner_id)
default_role = self.settings.db.get_default_role(
guildId=guild_id, categoryId=category_id, userId=owner_id
)
temp_default_role = utils.get_by_name_or_id(ctx.guild.roles, default_role) or ctx.guild.default_role
# text channel rename is automatically handled by the change event on the voice channel.

Expand Down Expand Up @@ -365,7 +373,9 @@ async def mute(self, ctx, userOrRole: typing.Optional[typing.Union[discord.Role,

owner = await self._users.get_or_fetch_user(owner_id)

default_role = self.settings.db.get_default_role(guildId=guild_id, categoryId=category_id, userId=owner_id)
default_role = self.settings.db.get_default_role(
guildId=guild_id, categoryId=category_id, userId=owner_id
)
everyone = utils.get_by_name_or_id(ctx.guild.roles, default_role) or ctx.guild.default_role
text_channel_id = self.channel_db.get_text_channel_id(guildId=guild_id, voiceChannelId=voice_channel_id)
text_channel = None
Expand Down Expand Up @@ -438,7 +448,9 @@ async def unmute(self, ctx, userOrRole: typing.Optional[typing.Union[discord.Rol
return

owner = await self._users.get_or_fetch_user(owner_id)
default_role = self.settings.db.get_default_role(guildId=guild_id, categoryId=category_id, userId=owner_id)
default_role = self.settings.db.get_default_role(
guildId=guild_id, categoryId=category_id, userId=owner_id
)
everyone = utils.get_by_name_or_id(ctx.guild.roles, default_role) or ctx.guild.default_role
text_channel_id = self.channel_db.get_text_channel_id(guildId=guild_id, voiceChannelId=voice_channel_id)
text_channel = None
Expand Down
4 changes: 3 additions & 1 deletion bot/cogs/channel_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ async def on_guild_channel_update(self, before, after):
self.log.debug(guild_id, _method , "Channel Names are the same. Nothing to do")
return
else:
default_role = self.settings.db.get_default_role(guildId=guild_id, categoryId=category_id, userId=owner_id)
default_role = self.settings.db.get_default_role(
guildId=guild_id, categoryId=category_id, userId=owner_id
)
self.log.debug(guild_id, _method, f"default_role: {default_role}")
temp_default_role = utils.get_by_name_or_id(after.guild.roles, default_role)
self.log.debug(guild_id, _method, f"temp_default_role: {temp_default_role}")
Expand Down

0 comments on commit 93be511

Please sign in to comment.