I am having a bit of an issue with a process that goes through all messages in a channel and evaluating them for certain reactions.
I have a loop and it looks for Exclamation Mark, Arrow Left, Red X and Green Tick in that order, as the posts are submissions to get checked by a mod.
for i in msg.reactions:
if str(i) == ("✅"):
status = "Complete"
break
elif str(i) == ("❌"):
status = "Complete"
break
elif str(i) == ("⬅️"):
status = "Reviewed"
elif str(i) == ("❗"):
status = "Claimed"
else:
status = "Unclaimed"
For whatever reason it absolutely will recognise the exclamation marks, and lists all ones with an exclamation mark as Unclaimed.
I have a feeling this might be the encoding I am using in Notepad++, but I've tried various set ups and can't seem to make it behave differently.
inoperator for containers:if str(i) in ("✅", "❌"): status = "Complete"or put it in a dictionary -status = {"✅": "Complete", "❌": "Complete", "⬅️": "Reviewed", "❗": "Claimed"}.get(str(i), "Unclaimed"). You could also use the unicode names for those symbols. - aneroidVS CodeorPyCharmas these are better IDEs for Python Programming. - Bhavyadeep Yadav