Skip to content

Commit 7e5d781

Browse files
committed
Reduce unnecessary internal variable declaration, move towards standard noqa.
1 parent 4a5f4aa commit 7e5d781

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

discord_slash/context.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ def __init__(
356356
self.subcommand_name = self.invoked_subcommand = self.subcommand_passed = None
357357
self.subcommand_group = self.invoked_subcommand_group = self.subcommand_group_passed = None
358358
self.command_id = _json["data"]["id"]
359-
self._discord = _discord
360359

361360
super().__init__(_http=_http, _json=_json, _discord=_discord, logger=logger)
362361

@@ -366,8 +365,7 @@ def cog(self) -> typing.Optional[commands.Cog]:
366365
Returns the cog associated with the command invoked, if any.
367366
"""
368367

369-
# noinspection PyUnresolvedReferences
370-
cmd_obj = self._discord.slash.commands[self.command] # above line, thanks PyCharm
368+
cmd_obj = self.bot.slash.commands[self.command] # noqa
371369

372370
if isinstance(cmd_obj, (model.CogBaseCommandObject, model.CogSubcommandObject)):
373371
return cmd_obj.cog

0 commit comments

Comments
 (0)