Introduces comprehensive invite handling capabilities including creation, deletion, and retrieval operations. Implements invite data model with proper parsing and representation methods to handle Discord invite objects and their metadata. Provides HTTP client methods for all invite-related API endpoints with appropriate error handling and response processing. Includes documentation with practical examples for common invite operations.
25 lines
427 B
Markdown
25 lines
427 B
Markdown
# Working with Invites
|
|
|
|
The library exposes helper methods for creating and deleting invites.
|
|
|
|
## Create an Invite
|
|
|
|
```python
|
|
invite = await client.create_invite("1234567890", {"max_age": 3600})
|
|
print(invite.code)
|
|
```
|
|
|
|
## Delete an Invite
|
|
|
|
```python
|
|
await client.delete_invite(invite.code)
|
|
```
|
|
|
|
## List Invites
|
|
|
|
```python
|
|
invites = await client.fetch_invites("1234567890")
|
|
for inv in invites:
|
|
print(inv.code, inv.uses)
|
|
```
|