Skip to content

Commit be257f1

Browse files
authored
correct a few mistakes
1 parent fe3096f commit be257f1

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

README.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,15 @@ async def buttons(ctx: commands.Context):
6464
await interaction.message.edit(embed=an_embed.add_field(name='Choose', value=f'Your Choose was `{button_id}`'), components=[components[0].edit_obj(1, disabled=True), components[1]])
6565

6666
elif button_id == 'sec_row_1st option':
67-
await interaction.message.edit(embed=an_embed.add_field(name='Choose', value=f'Your Choose was `{button_id}`'),
68-
components=[components[0], components[1].edit_obj(0, disabled=True)])
67+
await interaction.message.edit(embed=an_embed.add_field(name='Choose', value=f'Your Choose was `{button_id}`'), components=[components[0], components[1].edit_obj(0, disabled=True)])
6968

7069
# The Discord API doesn't send an event when you press a link button so we can't "receive" that.
71-
72-
client.run('Your Bot-Token here')
70+
71+
client.run('You Bot-Token here')
7372
```
74-
----------------------------------------------------------------------------------------------------
75-
```py
73+
---------------------------------------------------------------
7674

75+
```py
7776
# Another command where a small embed is sent where you can move the small white ⬜ with the buttons.
7877

7978
pointers = []
@@ -107,6 +106,7 @@ def get_pointer(obj: typing.Union[discord.Guild, int]):
107106
for p in pointers:
108107
if p.guild.id == obj.id:
109108
return p
109+
pointers.append(Pointer(obj))
110110
return get_pointer(obj)
111111

112112
elif isinstance(obj, int):
@@ -146,6 +146,18 @@ def arrow_button():
146146
return discord.Button(style=discord.ButtonStyle.Primary)
147147

148148

149+
@client.command(name="start_game")
150+
async def start_game(ctx: commands.Context):
151+
pointer: Pointer = get_pointer(ctx.guild)
152+
await ctx.send(embed=discord.Embed(title="Little Game",
153+
description=self.display(x=0, y=0)),
154+
components=[discord.ActionRow(self.empty_button, self.arrow_button.set_label('').set_custom_id('up'), self.empty_button),
155+
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'))
156+
]
157+
)
158+
159+
160+
@client.event
149161
async def on_raw_interaction_create(interaction: discord.RawInteractionCreateEvent):
150162
await interaction.defer()
151163
pointer: Pointer = get_pointer(interaction.guild)

0 commit comments

Comments
 (0)