No matter the notification settings, tip
will always be equal to NotificationLevel.only_mentions
. If you print notifications
before the if statements however, it will print the correct notification settings. Any ideas?
@bot.command()
async def notifications(ctx):
notifications = ctx.guild.default_notifications
if notifications == "NotificationLevel.only_mentions":
tip = "Tip: message1"
else:
tip = "Tip: message2"
CodePudding user response:
ctx.guild.default_notifications.name == "WhatYouWantToCompare"
Should be what you are looking for. You can't compare an Enum
the way you are trying to do this.
Adapted to your case, it would be:
if notifications.name == "only_mentions":