fix: Update button label to a visible character to comply with Discord API requirements
This commit is contained in:
parent
294292b7bc
commit
1048a631a4
@ -5,9 +5,9 @@ from typing import Optional, List
|
||||
# --- Tic Tac Toe (Player vs Player) ---
|
||||
class TicTacToeButton(ui.Button['TicTacToeView']):
|
||||
def __init__(self, x: int, y: int):
|
||||
# Use a space character for the initial label to avoid large buttons
|
||||
# Empty string ('') is not allowed as per Discord API requirements
|
||||
super().__init__(style=discord.ButtonStyle.secondary, label=' ', row=y)
|
||||
# Use a visible character for the label as Discord API requires non-empty labels
|
||||
# Empty string ('') or space character (' ') are not allowed as per Discord API requirements
|
||||
super().__init__(style=discord.ButtonStyle.secondary, label='·', row=y)
|
||||
self.x = x
|
||||
self.y = y
|
||||
|
||||
@ -118,7 +118,7 @@ class TicTacToeView(ui.View):
|
||||
# --- Tic Tac Toe Bot Game ---
|
||||
class BotTicTacToeButton(ui.Button['BotTicTacToeView']):
|
||||
def __init__(self, x: int, y: int):
|
||||
super().__init__(style=discord.ButtonStyle.secondary, label=' ', row=y)
|
||||
super().__init__(style=discord.ButtonStyle.secondary, label='·', row=y)
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.position = y * 3 + x # Convert to position index (0-8) for the TicTacToe engine
|
||||
|
Loading…
x
Reference in New Issue
Block a user