I have a dictionary
oracle = {
"odds": {
"note": "To get your answer, roll a die based on the odds of it being positive.",
4: "d4 Very Unlikely",
6: "d6 Unlikely",
8: "d8 Likely",
10: "d10 Very Likely",
12: "d12 Almost Certain",
},
"interpret": {
"1-2": "The answer is βNo, and...β",
"3-4": "The answer is βYes, but...β",
"5+": "The answer is βYes, and...β",
},
}
and my ui.View class
class DiceChoice(discord.ui.View):
def __init__(self, category: str):
super().__init__()
self.value = None
# default case
if category == "":
self.category = {odds}
@discord.ui.button(label="d4", style=discord.ButtonStyle.red)
async def d4(
self, button: discord.ui.Button, interaction: discord.Interaction
) -> None:
self.value = str(d20.roll("d4").result)
self.stop()
However if i try to use self in place of the "d4" in label= i get an error (screenshot)