[docs]@classmethoddefall(cls)->Self:""" `AllowedMentions`: Preset to allow all mentions """returncls(everyone=True,roles=True,users=True,replied_user=True)
[docs]@classmethoddefnone(cls)->Self:""" `AllowedMentions`: Preset to deny any mentions """returncls(everyone=False,roles=False,users=False,replied_user=False)
[docs]defto_dict(self)->dict:""" `dict`: Representation of the `AllowedMentions` that is Discord API friendly """parse=[]data={}ifself.everyone:parse.append("everyone")ifisinstance(self.users,list):data["users"]=[int(x)forxinself.users]elifself.usersisTrue:parse.append("users")ifisinstance(self.roles,list):data["roles"]=[int(x)forxinself.roles]elifself.rolesisTrue:parse.append("roles")ifself.reply_user:data["replied_user"]=Truedata["parse"]=parsereturndata