disunity 0.1.7__tar.gz → 0.1.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {disunity-0.1.7 → disunity-0.1.9}/PKG-INFO +74 -74
- {disunity-0.1.7 → disunity-0.1.9}/pyproject.toml +2 -2
- {disunity-0.1.7 → disunity-0.1.9}/setup.cfg +4 -4
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/models/components.py +6 -11
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity.egg-info/PKG-INFO +74 -74
- {disunity-0.1.7 → disunity-0.1.9}/LICENSE +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/README.md +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/__init__.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/cache.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/embed.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/errors.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/identifiers.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/models/__init__.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/models/context.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/models/interaction.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/models/member.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/models/message.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/models/user.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/package.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/server.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity/utils.py +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity.egg-info/SOURCES.txt +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity.egg-info/dependency_links.txt +0 -0
- {disunity-0.1.7 → disunity-0.1.9}/src/disunity.egg-info/top_level.txt +0 -0
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: disunity
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: Python framework for Discord interactions using a web server
|
|
5
|
-
Author: Tadeo Murillo,
|
|
6
|
-
Project-URL: Homepoge, https://github.com/murillotadeo/disunity
|
|
7
|
-
Project-URL: Bug Tracker, https://github.com/murillotadeo/disunity/issues
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.10.0
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
License-File: LICENSE
|
|
14
|
-
|
|
15
|
-
# disunity
|
|
16
|
-
|
|
17
|
-
Python framework for Discord interactions using a web server
|
|
18
|
-
|
|
19
|
-
# Installation
|
|
20
|
-
`pip install disunity`
|
|
21
|
-
|
|
22
|
-
# Introduction to Disunity
|
|
23
|
-
```python
|
|
24
|
-
import disunity
|
|
25
|
-
|
|
26
|
-
server = disunity.DisunityServer()
|
|
27
|
-
|
|
28
|
-
if __name__ == '__main__':
|
|
29
|
-
server.run()
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Using packages
|
|
33
|
-
```python
|
|
34
|
-
import disunity
|
|
35
|
-
import pathlib
|
|
36
|
-
|
|
37
|
-
server = disunity.DisunityServer()
|
|
38
|
-
|
|
39
|
-
@server.before_serving
|
|
40
|
-
def load_packages():
|
|
41
|
-
for package in [f"{f.parent}.{f.stem}" for f in pathlib.Path("packages").glob("*.py")]:
|
|
42
|
-
server.load_package(package)
|
|
43
|
-
|
|
44
|
-
if __name__ == '__main__':
|
|
45
|
-
server.run()
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
# Setting up a package
|
|
50
|
-
|
|
51
|
-
```python
|
|
52
|
-
from disunity import package, utils
|
|
53
|
-
|
|
54
|
-
class FirstPackage(package.Package):
|
|
55
|
-
def __init__(self, app):
|
|
56
|
-
self.app = app
|
|
57
|
-
|
|
58
|
-
@package.Package.command('ping')
|
|
59
|
-
async def ping(self, ctx):
|
|
60
|
-
return await ctx.callback("Pong!")
|
|
61
|
-
|
|
62
|
-
def setup(app):
|
|
63
|
-
app.register_package(FirstPackage(app))
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
# Disclaimer
|
|
68
|
-
|
|
69
|
-
This will require that you already have hosting service for the server to run on as well as a domain to host the server on. If you have neither of these, an alternative would be to host on Heroku using a web application with Gunicorn.
|
|
70
|
-
|
|
71
|
-
# Side note
|
|
72
|
-
|
|
73
|
-
The server will receive interactions to the `/interactions` endpoint of your server. It will look like this: `https://example.com/interactions`. Once you run the server, put the url with the added interactions endpoint into the `interactions` URL on your app located in the Discord developer portal.
|
|
74
|
-
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: disunity
|
|
3
|
+
Version: 0.1.9
|
|
4
|
+
Summary: Python framework for Discord interactions using a web server
|
|
5
|
+
Author: Tadeo Murillo,
|
|
6
|
+
Project-URL: Homepoge, https://github.com/murillotadeo/disunity
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/murillotadeo/disunity/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.10.0
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
|
|
15
|
+
# disunity
|
|
16
|
+
|
|
17
|
+
Python framework for Discord interactions using a web server
|
|
18
|
+
|
|
19
|
+
# Installation
|
|
20
|
+
`pip install disunity`
|
|
21
|
+
|
|
22
|
+
# Introduction to Disunity
|
|
23
|
+
```python
|
|
24
|
+
import disunity
|
|
25
|
+
|
|
26
|
+
server = disunity.DisunityServer()
|
|
27
|
+
|
|
28
|
+
if __name__ == '__main__':
|
|
29
|
+
server.run()
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Using packages
|
|
33
|
+
```python
|
|
34
|
+
import disunity
|
|
35
|
+
import pathlib
|
|
36
|
+
|
|
37
|
+
server = disunity.DisunityServer()
|
|
38
|
+
|
|
39
|
+
@server.before_serving
|
|
40
|
+
def load_packages():
|
|
41
|
+
for package in [f"{f.parent}.{f.stem}" for f in pathlib.Path("packages").glob("*.py")]:
|
|
42
|
+
server.load_package(package)
|
|
43
|
+
|
|
44
|
+
if __name__ == '__main__':
|
|
45
|
+
server.run()
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
# Setting up a package
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from disunity import package, utils
|
|
53
|
+
|
|
54
|
+
class FirstPackage(package.Package):
|
|
55
|
+
def __init__(self, app):
|
|
56
|
+
self.app = app
|
|
57
|
+
|
|
58
|
+
@package.Package.command('ping')
|
|
59
|
+
async def ping(self, ctx):
|
|
60
|
+
return await ctx.callback("Pong!")
|
|
61
|
+
|
|
62
|
+
def setup(app):
|
|
63
|
+
app.register_package(FirstPackage(app))
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
# Disclaimer
|
|
68
|
+
|
|
69
|
+
This will require that you already have hosting service for the server to run on as well as a domain to host the server on. If you have neither of these, an alternative would be to host on Heroku using a web application with Gunicorn.
|
|
70
|
+
|
|
71
|
+
# Side note
|
|
72
|
+
|
|
73
|
+
The server will receive interactions to the `/interactions` endpoint of your server. It will look like this: `https://example.com/interactions`. Once you run the server, put the url with the added interactions endpoint into the `interactions` URL on your app located in the Discord developer portal.
|
|
74
|
+
|
|
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
|
|
|
10
10
|
|
|
11
11
|
[project]
|
|
12
12
|
name = "disunity"
|
|
13
|
-
version = "0.1.
|
|
13
|
+
version = "0.1.9"
|
|
14
14
|
authors = [
|
|
15
15
|
{name="Tadeo Murillo"},
|
|
16
16
|
{name=""}
|
|
@@ -26,4 +26,4 @@ classifiers = [
|
|
|
26
26
|
|
|
27
27
|
[project.urls]
|
|
28
28
|
"Homepoge" = "https://github.com/murillotadeo/disunity"
|
|
29
|
-
"Bug Tracker" = "https://github.com/murillotadeo/disunity/issues"
|
|
29
|
+
"Bug Tracker" = "https://github.com/murillotadeo/disunity/issues"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[egg_info]
|
|
2
|
-
tag_build =
|
|
3
|
-
tag_date = 0
|
|
4
|
-
|
|
1
|
+
[egg_info]
|
|
2
|
+
tag_build =
|
|
3
|
+
tag_date = 0
|
|
4
|
+
|
|
@@ -58,7 +58,7 @@ class Button:
|
|
|
58
58
|
custom_id: str | None,
|
|
59
59
|
label: str,
|
|
60
60
|
style: int = ButtonStyles.PRIMARY,
|
|
61
|
-
emoji: dict
|
|
61
|
+
emoji: dict = {},
|
|
62
62
|
url: str | None = None,
|
|
63
63
|
disabled: bool = False,
|
|
64
64
|
):
|
|
@@ -67,12 +67,9 @@ class Button:
|
|
|
67
67
|
"custom_id": custom_id,
|
|
68
68
|
"label": label,
|
|
69
69
|
"style": style,
|
|
70
|
-
"
|
|
70
|
+
"emoji": emoji,
|
|
71
|
+
"disabled": disabled,
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
# Very wonky patch for whatever the hell Discord just did
|
|
74
|
-
if emoji and isinstance(emoji, dict):
|
|
75
|
-
self.dict["emoji"] = emoji
|
|
76
73
|
|
|
77
74
|
if self.dict["style"] == ButtonStyles.LINK and url is not None:
|
|
78
75
|
self.dict["url"] = url
|
|
@@ -98,17 +95,15 @@ class SelectMenuOption:
|
|
|
98
95
|
"""
|
|
99
96
|
|
|
100
97
|
def __init__(
|
|
101
|
-
self, label: str, value: str | int, description: str = "", emoji: dict
|
|
98
|
+
self, label: str, value: str | int, description: str = "", emoji: dict = {}
|
|
102
99
|
):
|
|
103
100
|
self.dict = {
|
|
104
101
|
"label": label,
|
|
105
102
|
"value": value,
|
|
106
|
-
"description": description
|
|
103
|
+
"description": description,
|
|
104
|
+
"emoji": emoji,
|
|
107
105
|
}
|
|
108
106
|
|
|
109
|
-
if emoji and isinstance(emoji, dict):
|
|
110
|
-
self.dict["emoji"] = emoji
|
|
111
|
-
|
|
112
107
|
def to_dict(self) -> dict:
|
|
113
108
|
return self.dict
|
|
114
109
|
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: disunity
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: Python framework for Discord interactions using a web server
|
|
5
|
-
Author: Tadeo Murillo,
|
|
6
|
-
Project-URL: Homepoge, https://github.com/murillotadeo/disunity
|
|
7
|
-
Project-URL: Bug Tracker, https://github.com/murillotadeo/disunity/issues
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.10.0
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
License-File: LICENSE
|
|
14
|
-
|
|
15
|
-
# disunity
|
|
16
|
-
|
|
17
|
-
Python framework for Discord interactions using a web server
|
|
18
|
-
|
|
19
|
-
# Installation
|
|
20
|
-
`pip install disunity`
|
|
21
|
-
|
|
22
|
-
# Introduction to Disunity
|
|
23
|
-
```python
|
|
24
|
-
import disunity
|
|
25
|
-
|
|
26
|
-
server = disunity.DisunityServer()
|
|
27
|
-
|
|
28
|
-
if __name__ == '__main__':
|
|
29
|
-
server.run()
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Using packages
|
|
33
|
-
```python
|
|
34
|
-
import disunity
|
|
35
|
-
import pathlib
|
|
36
|
-
|
|
37
|
-
server = disunity.DisunityServer()
|
|
38
|
-
|
|
39
|
-
@server.before_serving
|
|
40
|
-
def load_packages():
|
|
41
|
-
for package in [f"{f.parent}.{f.stem}" for f in pathlib.Path("packages").glob("*.py")]:
|
|
42
|
-
server.load_package(package)
|
|
43
|
-
|
|
44
|
-
if __name__ == '__main__':
|
|
45
|
-
server.run()
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
# Setting up a package
|
|
50
|
-
|
|
51
|
-
```python
|
|
52
|
-
from disunity import package, utils
|
|
53
|
-
|
|
54
|
-
class FirstPackage(package.Package):
|
|
55
|
-
def __init__(self, app):
|
|
56
|
-
self.app = app
|
|
57
|
-
|
|
58
|
-
@package.Package.command('ping')
|
|
59
|
-
async def ping(self, ctx):
|
|
60
|
-
return await ctx.callback("Pong!")
|
|
61
|
-
|
|
62
|
-
def setup(app):
|
|
63
|
-
app.register_package(FirstPackage(app))
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
# Disclaimer
|
|
68
|
-
|
|
69
|
-
This will require that you already have hosting service for the server to run on as well as a domain to host the server on. If you have neither of these, an alternative would be to host on Heroku using a web application with Gunicorn.
|
|
70
|
-
|
|
71
|
-
# Side note
|
|
72
|
-
|
|
73
|
-
The server will receive interactions to the `/interactions` endpoint of your server. It will look like this: `https://example.com/interactions`. Once you run the server, put the url with the added interactions endpoint into the `interactions` URL on your app located in the Discord developer portal.
|
|
74
|
-
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: disunity
|
|
3
|
+
Version: 0.1.9
|
|
4
|
+
Summary: Python framework for Discord interactions using a web server
|
|
5
|
+
Author: Tadeo Murillo,
|
|
6
|
+
Project-URL: Homepoge, https://github.com/murillotadeo/disunity
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/murillotadeo/disunity/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.10.0
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
|
|
15
|
+
# disunity
|
|
16
|
+
|
|
17
|
+
Python framework for Discord interactions using a web server
|
|
18
|
+
|
|
19
|
+
# Installation
|
|
20
|
+
`pip install disunity`
|
|
21
|
+
|
|
22
|
+
# Introduction to Disunity
|
|
23
|
+
```python
|
|
24
|
+
import disunity
|
|
25
|
+
|
|
26
|
+
server = disunity.DisunityServer()
|
|
27
|
+
|
|
28
|
+
if __name__ == '__main__':
|
|
29
|
+
server.run()
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Using packages
|
|
33
|
+
```python
|
|
34
|
+
import disunity
|
|
35
|
+
import pathlib
|
|
36
|
+
|
|
37
|
+
server = disunity.DisunityServer()
|
|
38
|
+
|
|
39
|
+
@server.before_serving
|
|
40
|
+
def load_packages():
|
|
41
|
+
for package in [f"{f.parent}.{f.stem}" for f in pathlib.Path("packages").glob("*.py")]:
|
|
42
|
+
server.load_package(package)
|
|
43
|
+
|
|
44
|
+
if __name__ == '__main__':
|
|
45
|
+
server.run()
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
# Setting up a package
|
|
50
|
+
|
|
51
|
+
```python
|
|
52
|
+
from disunity import package, utils
|
|
53
|
+
|
|
54
|
+
class FirstPackage(package.Package):
|
|
55
|
+
def __init__(self, app):
|
|
56
|
+
self.app = app
|
|
57
|
+
|
|
58
|
+
@package.Package.command('ping')
|
|
59
|
+
async def ping(self, ctx):
|
|
60
|
+
return await ctx.callback("Pong!")
|
|
61
|
+
|
|
62
|
+
def setup(app):
|
|
63
|
+
app.register_package(FirstPackage(app))
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
# Disclaimer
|
|
68
|
+
|
|
69
|
+
This will require that you already have hosting service for the server to run on as well as a domain to host the server on. If you have neither of these, an alternative would be to host on Heroku using a web application with Gunicorn.
|
|
70
|
+
|
|
71
|
+
# Side note
|
|
72
|
+
|
|
73
|
+
The server will receive interactions to the `/interactions` endpoint of your server. It will look like this: `https://example.com/interactions`. Once you run the server, put the url with the added interactions endpoint into the `interactions` URL on your app located in the Discord developer portal.
|
|
74
|
+
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|