@@ -68,6 +68,8 @@ client.run('You Bot-Token here')
68
68
---------------------------------------------------------------
69
69
70
70
``` py
71
+ # Another command where a small embed is sent where you can move the small white ⬜ with the buttons.
72
+
71
73
pointers = []
72
74
73
75
@@ -79,7 +81,7 @@ class Pointer:
79
81
80
82
@ property
81
83
def possition_x (self ):
82
- return self . _possition_x
84
+ return _possition_x
83
85
84
86
def set_x (self , x : int ):
85
87
self ._possition_x += x
@@ -143,9 +145,9 @@ def arrow_button():
143
145
async def start_game (ctx : commands.Context):
144
146
pointer: Pointer = get_pointer(ctx.guild)
145
147
await ctx.send(embed = discord.Embed(title = " Little Game" ,
146
- description = self . display(x = 0 , y = 0 )),
147
- components = [discord.ActionRow(self . empty_button, self . arrow_button.set_label(' ↑' ).set_custom_id(' up' ), self . empty_button),
148
- discord.ActionRow(self . arrow_button.set_label(' ←' ).set_custom_id(' left' ).disable_if(pointer.possition_x <= 0 ), self . arrow_button.set_label(' ↓' ).set_custom_id(' down' ).disable_if(pointer.possition_y <= 0 ), self . arrow_button.set_label(' →' ).set_custom_id(' right' ))
148
+ description = display(x = 0 , y = 0 )),
149
+ components = [discord.ActionRow(empty_button, arrow_button.set_label(' ↑' ).set_custom_id(' up' ), empty_button),
150
+ discord.ActionRow(arrow_button.set_label(' ←' ).set_custom_id(' left' ).disable_if(pointer.possition_x <= 0 ), arrow_button.set_label(' ↓' ).set_custom_id(' down' ).disable_if(pointer.possition_y <= 0 ), arrow_button.set_label(' →' ).set_custom_id(' right' ))
149
151
]
150
152
)
151
153
0 commit comments