Skip to content

Conversation

sondevra
Copy link
Contributor

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

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

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.

What happens is when no commands have been loaded to a Discord guild's scope, but they are cached, if a user tries to request one of these cached commands, an error occurs because of the way the lookup was handled (index notation)

Changes

  • Changed index notation to .get() on the dictionary.

Related Issues

Test Scenarios

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

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 <[email protected]>
@sondevra
Copy link
Contributor Author

@AstreaTSS need your help adding reviewers.

@AstreaTSS
Copy link
Member

Reviewers don't need to be manually added - the contributors of interactions.py will see this and review whenever they can on their own.

Signed-off-by: Sondra <[email protected]>
@silasary silasary merged commit 42df28b into interactions-py:unstable Jul 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants