Skip to content

Commit 4c67207

Browse files
chore: overall enhancement
1 parent 632ec12 commit 4c67207

File tree

5 files changed

+136
-18
lines changed

5 files changed

+136
-18
lines changed
Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
11
---
22
title: Installation
3-
---
3+
---
4+
5+
Before you can start using Pycord, you need to install the library.
6+
7+
:::note
8+
Python **3.8 or above** is required to use Pycord.
9+
:::
10+
11+
## Fresh Installation
12+
13+
To install Pycord, you can use the following command in your terminal:
14+
15+
python3 -m pip install py-cord
16+
17+
:::caution
18+
Remember that you need to install `py-cord`, not `pycord`.
19+
:::
20+
21+
If you need voice support for your bot, you should run:
22+
23+
python3 -m pip install "py-cord[voice]"
24+
25+
## Migration
26+
27+
### Updating Pycord
28+
29+
If you are upgrading from a previous version of Pycord, you can use the following command in your terminal:
30+
31+
python3 -m pip install -U py-cord
32+
33+
34+
### Migrating from other libraries
35+
36+
If you are migrating from another library, say, `discord.py`, first of all, you need to uninstall the library.
37+
38+
python3 -m pip uninstall discord.py
39+
40+
Then, you can install Pycord:
41+
42+
python3 -m pip install py-cord
43+
44+
:::caution
45+
Warning Uninstalling `discord.py` after installing `py-cord` can cause issues.
46+
:::
47+
48+
## Installing Other Builds
49+
50+
### Development Build
51+
52+
:::caution Warning
53+
The development build may not be stable and cause bugs.
54+
:::
55+
56+
To install the development build, you can use the following command in your terminal:
57+
58+
python -m pip install -U git+https://github.com/Pycord-Development/pycord
59+
60+
:::note
61+
Git is required to install this build. [Learn how you can install Git](/guide/Topics/git).
62+
:::
63+
64+
## FAQ
65+
66+
### Why is it that the library called Pycord but the package is called py-cord?
67+
68+
Pycord is also the name of another API Wrapper. However, that wrapper is not maintained any longer. PyPi does not allow you to install a package with the same name as another package. Therefore, this new library had to be called `py-cord`. However, since it's harder to keep calling it Py-cord, we decided to call it Pycord.
69+
70+
71+

docs/Interactions/buttons.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ async def button(ctx):
4545

4646
bot.run("TOKEN") # Run the bot
4747
```
48-
Using this `button` command should return the following message:
48+
49+
Using this command should return the following message:
4950

5051
<DiscordMessages>
5152
<DiscordMessage author="Guide Bot" avatar="red" bot>
@@ -61,6 +62,7 @@ Using this `button` command should return the following message:
6162
</DiscordMessage>
6263
</DiscordMessages>
6364

65+
<br />
6466

6567
As you can see, we create a class called `View` that [subclasses](#oop) [`discord.ui.View`](https://docs.pycord.dev/en/master/api.html#discord.ui.Button).
6668

@@ -85,14 +87,14 @@ This is the basic syntax of creating a button. What you create with it is up to
8587
Check out the [`discord.ButtonStyle`](https://docs.pycord.dev/en/master/api.html#discord.ButtonStyle) class for more information.
8688

8789

90+
8891
![Different Button Styles](button-styles.png)
8992

9093

9194
You can set a button's style by adding the `style` argument in the [`discord.ui.button`](https://docs.pycord.dev/en/master/api.html#discord.ui.button) decorator.
9295

9396
```python
9497
class View(discord.ui.View):
95-
9698
@discord.ui.button(label="Click me!", style=discord.ButtonStyle.success)
9799
async def button_callback(self, button, interaction):
98100
await interaction.response.send_message("You clicked the button!")
@@ -148,11 +150,13 @@ class MyView(discord.ui.View):
148150

149151
```python
150152
class MyView(discord.ui.View):
153+
151154
@discord.ui.button(emoji="😀", label="Button 1", style=discord.ButtonStyle.primary)
152155
async def button_callback(self, button, interaction):
153156
for child in self.children: # loop through all the children of the view
154157
child.disabled = True # set the button to disabled
155158
await interaction.response.edit_message(view=self)
159+
156160
@discord.ui.button(label="Button 2", style=discord.ButtonStyle.primary)
157161
async def second_button_callback(self, button, interaction):
158162
for child in self.children:

docs/Topics/git.mdx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Installing Git
3+
---
4+
5+
Git is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows (thousands of parallel branches running on different systems).
6+
7+
Let's see how we can install Git on different platforms.
8+
9+
## Windows
10+
11+
On windows, Git can be installed via:
12+
13+
- [Git for Windows](https://gitforwindows.org)
14+
- [Git Scm](https://git-scm.com/download/windows)
15+
16+
## Linux
17+
18+
On Linux, Git is probably already installed in your distros repository. If not, you can install it via [Git for Linux](https://git-scm.com/download/linux)
19+
20+
## Mac
21+
22+
You may have to install it via [Git for Mac](https://git-scm.com/download/mac)
23+
24+
## Using Package Managers
25+
26+
You can install Git using package managers.
27+
28+
### Choco
29+
30+
If you use the Choco package manager, you can install Git using:
31+
32+
choco install git
33+
34+
35+
### Scoop
36+
37+
If you use Scoop, you can install Git using:
38+
39+
scoop install git

docusaurus.config.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const config = {
4444
themeConfig: {
4545
colorMode: {
4646
defaultMode: 'dark',
47-
disableSwitch: true
47+
disableSwitch: true,
4848
},
4949
navbar: {
5050
title: 'Pycord Guide',
@@ -63,33 +63,40 @@ const config = {
6363
{
6464
title: 'Community',
6565
items: [
66+
{
67+
label: 'Discord',
68+
href: 'https://discord.gg/pycord',
69+
},
6670
{
6771
label: 'Stack Overflow',
6872
href: 'https://stackoverflow.com/questions/tagged/pycord',
6973
},
74+
75+
76+
],
77+
},
78+
79+
{
80+
title: 'Pycord',
81+
items: [
7082
{
71-
label: 'Discord',
72-
href: 'https://discord.gg/pycord',
83+
label: 'Documentation',
84+
href: 'https://docs.pycord.dev',
7385
},
7486
{
7587
label: 'Github',
7688
href: 'https://github.com/Pycord-Development',
7789
},
78-
],
79-
},
80-
/*{
81-
title: 'More',
82-
items: [
8390
{
84-
label: 'Twitter',
85-
to: 'https://twitter.com/PycordDev',
91+
label: 'Website',
92+
href: 'https://pycord.dev',
8693
},
8794
{
88-
label: 'GitHub',
89-
href: 'https://github.com/p',
95+
label: 'Twitter',
96+
href: 'https://twitter.com/PycordDev',
9097
},
9198
],
92-
},*/
99+
},
93100
],
94101
copyright: `Copyright © ${ new Date().getFullYear() } Pycord Development`,
95102
},

sidebars.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ const sidebars = {
5454
},
5555
{
5656
type: 'category',
57-
label: "topics",
58-
items: ["Topics/community-resources", "Topics/subclassed-bot"]
57+
label: "Topics",
58+
items: ["Topics/community-resources", "Topics/git", "Topics/subclassed-bot"]
5959
}
6060
],
6161

0 commit comments

Comments
 (0)