This commit fixes SFUAnime/Ren#629 , which raises AttributeError when trying to run [p]birthday self set. The root cause is when a user has not had a DM session with the bot before, then dm_channel for that user will return NoneType.
Since the mainFlow helper uses the send method on a channel, we can instead substitute it for a Messageable type, and replace dm_channel with the user itself, and we can still use either the triggering ctx.channel or ctx.author
Description of the changes
This commit fixes SFUAnime/Ren#629 , which raises AttributeError when trying to run
[p]birthday self set
. The root cause is when a user has not had a DM session with the bot before, thendm_channel
for that user will returnNoneType
.Since the
mainFlow
helper uses thesend
method on a channel, we can instead substitute it for aMessageable
type, and replacedm_channel
with the user itself, and we can still use either the triggeringctx.channel
orctx.author
Tested with the help of @abelathomas :