Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit dec98be

Browse files
author
kuso-senpai
committed
fixed small issues
1 parent 05f1780 commit dec98be

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ Represents an Object of a Button which was pressed, including its interaction
416416
<details>
417417
<summary><b>Attributes</b></summary>
418418

419-
- member: `discord.GuildMember`
419+
- member: `discord.Member`
420420
> The member who pressed the button
421421

422422
- interaction: `dict`

discord_py_buttons/receive.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,20 +331,32 @@ def __init__(self, *, state, channel, data, user, client):
331331
super().__init__(state=state, channel=channel, data=data["message"])
332332

333333
self._discord = client
334-
self.acknowledged = False
334+
self.deferred = False
335335
for x in self.buttons:
336336
if hasattr(x, 'custom_id') and x.custom_id == data["data"]["custom_id"]:
337337
self.pressedButton = PressedButton(data, user, x)
338338

339339
async def defer(self, hidden=False):
340340
"""
341+
| coro |
342+
341343
This will acknowledge the interaction. This will show the (*Bot* is thinking...) Dialog
342344
343345
This function should be used if the Bot needs more than 15 seconds to respond
346+
347+
Parameter
348+
----------------
349+
```py
350+
(bool) hidden
351+
```
352+
Whether the loading thing will be only visible to the user
353+
Default: `False`
354+
355+
344356
"""
345357

346358
body = {"type": 5}
347-
if hidden == True:
359+
if hidden:
348360
body |= { "flags": 64 }
349361

350362
await self._discord.http.request(V8Route("POST", f'/interactions/{self.pressedButton.interaction["id"]}/{self.pressedButton.interaction["token"]}/callback'), json=body)
@@ -356,7 +368,7 @@ async def respond(self, content=None, *, tts=False, embed = None, embeds=None, f
356368
"""
357369
| coro |
358370
359-
Function to respond to the interaction
371+
Responds to the interaction
360372
361373
362374
Parameters

0 commit comments

Comments
 (0)