Closed DerpyWasHere closed 3 months ago
Upon further review, simply returning None seems to be a good enough solution. We might instead want to ensure that the function has some sort of docstring stating that the channel id (cid) must be exact else the function returns None.
I opted to use typing to convey this (returning a union with the None type)
As referenced in PR #26, the
get_channel()
andget_role_by_id()
functions don't perform any null checking and could potentially operate on empty lists. This is less of an issue on get_role_by_id(), but we may want to be more fussy onget_channel()
.I suggest we either perform null checking on the result of next as the dataclasses (Channel) expect non-null values, or assign default values to the
next()
calls.