dolfies / discord.py-self

A fork of the popular discord.py for user accounts.
https://discordpy-self.rtfd.io/en/latest/
MIT License
720 stars 165 forks source link

Refactor: improve ID comparison for get_message #711

Closed bhu34905 closed 4 months ago

bhu34905 commented 4 months ago

Summary

This pull request refactors the get_message function to improve ID comparison. It changes the comparison from integer conversion to string comparison, enhancing code readability and avoiding unnecessary type conversions.

General Info

MCausc78 commented 4 months ago

Comparing ints is much faster than comparing strings. Also, it just works, so why change it?

bhu34905 commented 4 months ago

Comparing ints is much faster than comparing strings. Also, it just works, so why change it?

message_id: Snowflake Snowflake allows passing in str and int. If a str type is passed, it will throw an error. This is not a meaningless modification. @dolfies