Skip to content

Commit ef29882

Browse files
committed
docs: merge downstream docs changes
2 parents 9317dc4 + 8459437 commit ef29882

File tree

13 files changed

+108
-152
lines changed

13 files changed

+108
-152
lines changed

docs/_snippets/discord_inv.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[:fontawesome-brands-discord:Discord Server](https://discord.gg/hpfNhH8BsY)
1+
[:fontawesome-brands-discord:Discord Server](https://discord.gg/interactions)

docs/src/Guides/01 Getting Started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Introduction
22

3-
Hi! So you want to make a bot starting from naffing. This guide aims to get you started as fast as possible, for more advanced use-cases check out the other guides.
3+
Ready to get your Python on and create a Discord bot? This guide's got you covered with installation options and a basic bot code example.
44

55
### Requirements
66

@@ -70,12 +70,12 @@ There are two different ways to install this library and create your bot.
7070

7171
=== ":material-linux: Linux"
7272
```shell
73-
python3 -m pip install naff --upgrade
73+
python3 -m pip install discord-py-interactions --upgrade
7474
```
7575

7676
=== ":material-microsoft-windows: Windows"
7777
```shell
78-
py -3 -m pip install naff --upgrade
78+
py -3 -m pip install discord-py-interactions --upgrade
7979
```
8080

8181
### Basic bot

docs/src/Guides/10 Events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ bot = Client(intents=Intents.DEFAULT)
1212
bot.start("Put your token here")
1313
```
1414

15-
For more information, please visit the API reference [here](/interactions.py/API Reference/API Reference/models/Discord/enums/#naff.models.discord.enums.Intents).
15+
For more information, please visit the API reference [here](/interactions.py/API Reference/API Reference/models/Discord/enums/#internal.models.discord.enums.Intents).
1616

1717
## Hey Listen!!!
1818

Lines changed: 1 addition & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1 @@
1-
# 1.x -> 2.x Migration Guide
2-
2.x Was a rewrite of various parts of Naff, and as such, there are a few breaking changes. This guide will help you migrate your code from 1.x to 2.x.
3-
4-
Please note; there are other additions to 2.x, but they are not breaking changes, and as such, are not covered in this guide.
5-
6-
## Misc.
7-
- All `edit` methods are now keyword arguments only.
8-
- The exception is `content` on message edits, which is positional.
9-
- `context.interaciton_id` is now an `int` instead of a `str`.
10-
11-
## Selects
12-
To simplify SelectMenus, NAFF made some changes to how SelectMenus are used.
13-
- Options can now be and *reasonable* type, be it `SelectOption`, `dict`, `iterable` or `str`
14-
- All parameters are now keyword only, excpet for `options` which remains positional or keyword
15-
- `Select` was renamed to `StringSelectMenu`
16-
- New select menus were implemented to support API changes
17-
- https://discord.com/developers/docs/interactions/message-components#select-menus
18-
- `UserSelectMenu`
19-
- `RoleSelectMenu`
20-
- `MentionableSelectMenu`
21-
- `ChannelSelectMenu`
22-
- `ChannelSelectMenu`
23-
24-
### Before
25-
```python
26-
from naff import Select, SelectOption
27-
await channel.send(
28-
"Old SelectUX",
29-
components=Select(
30-
options=[
31-
SelectOption("test1", "test1"),
32-
SelectOption("test2", "test2"),
33-
SelectOption("test3", "test3"),
34-
],
35-
placeholder="test",
36-
),
37-
)
38-
```
39-
40-
### After
41-
```python
42-
from naff import StringSelectMenu
43-
44-
await channel.send(
45-
"New SelectMenu Menu UX test", components=StringSelectMenu(["test1", "test2", "test3"], placeholder="test")
46-
)
47-
```
48-
49-
## Listeners
50-
Listeners have received a series of ease-of-use updates for both extension and bot developers alike.
51-
52-
- All internal listeners now have a `is_default_listener` attribute to make it easier to differentiate between the library's listeners and user defined listeners.
53-
- `override_default_listeners` allows you to completely override the library's listeners with your own.
54-
- Note it might be worth looking into processors if you're doing this; as they allow acting on the raw-payloads before they're processed by the library.
55-
- All event objects now have a shortcut to listen to them via `BaseEvent.listen(coro, Client)`
56-
- Listeners can now be delayed until the client is ready with a `delay_until_ready` argument.
57-
58-
## Events
59-
- All event objects now have a shortcut to listen to them via `BaseEvent.listen(coro, Client)`
60-
- New Events!
61-
- `ComponentCompletion` - Dispatched after the library ran any component callback.
62-
- `AutocompleteCompletion` - Dispatched after the library ran any autocomplete callback.
63-
- `ModalCompletion` - Dispatched after the library ran any modal callback.
64-
- `Error` - Dispatched whenever the libray encounters an unhandled exception.
65-
- Previously this was done by overriding the `on_error` method on the client, or in extensions
66-
- `CommandError` - Dispatched whenever a command encounters an unhandled exception.
67-
- `ComponentError` - Dispatched whenever a component encounters an unhandled exception.
68-
- `AutocompleteError` - Dispatched whenever an autocomplete encounters an unhandled exception.
69-
- `ModalError` - Dispatched whenever a modal encounters an unhandled exception.
70-
- `NewThreadCreate` - Dispatched whenever a thread is newly created
71-
- `GuildAvailable` - Dispatched whenever a guild becomes available
72-
- note this requires the guild cache to be enabled
73-
- `ApplicationCommandPermissionsUpdate` - Dispatched whenever a guild's application command permissions are updated
74-
- `VoiceUserDeafen` - Dispatched whenever a user's deafen status changes
75-
- `VoiceUserJoin` - Dispatched whenever a user joins a voice channel
76-
- `VoiceUserLeave` - Dispatched whenever a user leaves a voice channel
77-
- `VoiceUserMove` - Dispatched whenever a user moves to a different voice channel
78-
- `VoiceUserMute` - Dispatched whenever a user's mute status changes
79-
- Event Renamed
80-
- `Button` has been renamed to `ButtonPressed` to avoid naming conflicts
81-
- All events with a `context` attribute have had it renamed to `ctx` for consistency
82-
83-
## Client Changes
84-
- dm commands can now be disabled completely via the `disable_dm_commands` kwarg
85-
- `Client.interaction_tree` offers a command tree of all application commands registered to the client
86-
- The `Client` now sanity checks the cache configuration
87-
- The `Client` will no longer warn you if a cache timeout occurs during startup
88-
- These are caused by T&S shadow-deleting guilds, and are not a concern
89-
- `async_startup_tasks` are now performed as soon as the client successfully connects to the REST API
90-
- Note this is before the gateway connection is established, use a `on_ready` listener if you need to wait for the gateway connection
91-
- Application Command syncing is now more error tolerant
92-
93-
## Extensions
94-
- Extensions no longer require a `setup` entrypoint function.
95-
- For complex setups, I would still advise using an entrypoint function
96-
97-
## Caching
98-
- A `NullCache` object is now used to represent a disabled cache, to use it use `create_cache(0, 0, 0)` in a client kwarg as before
99-
- This is a very niche-use-case and most people won't need to use it
100-
- The `Client` will log a warning if `NullCache` is used for sanity checking
101-
- The serializer now respects `no_export` metadata when using `as_dict`
102-
103-
## Forums
104-
- Forums now utilise the new API spec instead of the private-beta API
105-
- A new `NewThreadCreate` event is now dispatched for brand new threads
106-
- Add various helper methods to `Forum` objects
107-
- `create_post` now handles `str`, `int` `Tag` objects for available tags
108-
109-
## Emoji
110-
- `PartialEmoji.from_str` can now return None if no emoji is found
1+
!!! Placeholder for 2.x migration guide

docs/src/Guides/99 Migration From D.py.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Migration From discord.py
22

33
1. interactions.py requires python 3.10 (as compared to dpy's 3.5), you may need to upgrade python.
4-
- If you see `ERROR: Could not find a version that satisfies the requirement naff (from versions: none)` when trying to `pip install NAFF`, this is your problem.
4+
- If you see `ERROR: Could not find a version that satisfies the requirement discord-py-interactions (from versions: none)` when trying to `pip install discord-py-interactions`, this is your problem.
55

66
2. Classes/Models
77
- Your client is `interactions.Client`.

docs/src/Guides/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ These guides are meant to help you get started with the library and offer a poin
77

88
---
99

10-
So you want to make a bot starting from naffing. This guide aims to get you started as fast as possible.
10+
Ready to get your Python on and create a Discord bot? This guide's got you covered with installation options and a basic bot code example.
1111

1212
- [__:material-hammer-screwdriver: Creating Your Bot__](02 Creating Your Bot.md)
1313

1414
---
1515

16-
How to make a bot on the Discord Developer Dashboard.
16+
Want to create your own bot but don't know where to start? This guide has you covered from bot-tom to top!
1717

1818
- [__:material-slash-forward-box: Slash Commands__](03 Creating Commands.md)
1919

2020
---
2121

22-
So you want to make a slash command (or interaction, as they are officially called), but don't know how to get started? Then this is the right place for you.
22+
Slash commands are a cut above the rest - this guide will show you how to create your very own slash commands.
2323

2424
- [__:material-menu-open: Context Menus__](04 Context Menus.md)
2525

2626
---
2727

28-
Interact with users in a more natural way. Just use the second button on your mouse.
28+
Create menus that are so good, they'll have your users right-clicking for more.
2929

3030
- [__:material-button-cursor: Components__](05 Components.md)
3131

@@ -37,7 +37,7 @@ These guides are meant to help you get started with the library and offer a poin
3737

3838
---
3939

40-
As everyone knows from surfing the web, popups are really great. Everyone loves them and they make for a great UX. Luckily for you, you have the option to regale your users love for them by using modals.
40+
Ready to pop-up your user interface game? This guide will show you how to create modals.
4141

4242
- [__:material-account-convert: Converters__](08 Converters.md)
4343

@@ -110,7 +110,7 @@ These guides are meant to help you get started with the library and offer a poin
110110

111111
---
112112

113-
How do I migrate from 1.x to 2.x?
113+
How do I migrate from i.py v4.4 to v5?
114114

115115

116116
</div>

docs/src/extra.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,12 @@ div.doc-contents:not(.first) {
189189
.md-typeset .grid.cards > :is(ul, ol) > li, .md-typeset .grid > .card{
190190
background-color: var(--md-card-color);
191191
}
192+
193+
/* squishes the logo and header together */
194+
.md-ellipsis{
195+
margin-left: 0;
196+
}
197+
.md-header__button.md-logo{
198+
margin-right: 0;
199+
filter: brightness(0) invert(1); /* makes the logo white */
200+
}

docs/src/images/favicon.png

-262 KB
Loading

docs/src/images/logo-minified.svg

Lines changed: 13 additions & 3 deletions
Loading

docs/src/images/logo.png

3.6 MB
Loading

0 commit comments

Comments
 (0)