Skip to content

Commit 42df28b

Browse files
authored
fix: command lookup error when scope is cached (#1716)
* fix: command lookup error when scope is cached Fixed lookup to use .get() on the dictionary to prevent large log of error in the circumstance of a cache command showing on a changed scope Signed-off-by: Sondra <125593620+sondevra@users.noreply.github.com> * Update context.py Signed-off-by: Sondra <125593620+sondevra@users.noreply.github.com> --------- Signed-off-by: Sondra <125593620+sondevra@users.noreply.github.com>
1 parent 2a896b7 commit 42df28b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

interactions/models/internal/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ def author_permissions(self) -> Permissions:
345345
return Permissions(0)
346346

347347
@property
348-
def command(self) -> InteractionCommand:
349-
return self.client._interaction_lookup[self._command_name]
348+
def command(self) -> typing.Optional[InteractionCommand]:
349+
return self.client._interaction_lookup.get(self._command_name)
350350

351351
@property
352352
def expires_at(self) -> Timestamp:

0 commit comments

Comments
 (0)