Apollo-Roboto / discord.py-ext-prometheus

Add Prometheus to your Discord bot with this handy extension
https://pypi.org/project/discord-ext-prometheus/
MIT License
18 stars 5 forks source link

fix: error triggered by DM commands #4

Closed seriaati closed 1 year ago

seriaati commented 1 year ago

DM commands have guild as None, causing the on_interaction and on_command listeners to raise errors since the listeners are trying to access shard_id from a NoneType guild.

This pull request adds NoneType checks to shard_id in both listeners, shard_id will be None if guild is None.

Apollo-Roboto commented 1 year ago

Thank you so much for this pull request!

I'll merge this and jump to version 0.1.1 to include it.