Skip to content

Commit 82c07d9

Browse files
committed
Archive documentation
1 parent f1bbdb8 commit 82c07d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+21928
-15
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: 50c7491bfb02711fb31d710e9bae27ba
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
59 4147386
Binary file not shown.
40.7 KB
Loading
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Changelog
2+
========================
3+
.. seealso::
4+
`Releases <https://github.com/davidhozic/discord-advertisement-framework/releases>`_
5+
6+
.. note::
7+
The library first started as a single file script that I didn't make versions of.
8+
When I decided to turn it into a library, I've set the version number based on the amount of commits I have made since the start.
9+
10+
v2.0
11+
----------------------
12+
- New cool looking web documentation (the one you're reading now)
13+
- Added volume parameter to :ref:`VoiceMESSAGE`
14+
- Changed ``channel_ids`` to ``channels`` for :ref:`VoiceMESSAGE` and :ref:`TextMESSAGE`. It can now also accept discord.<Type>Channel objects.
15+
- Changed ``user_id``/ ``guild_id`` to ``snowflake`` in :ref:`GUILD` and :ref:`USER`. This parameter now also accept discord.Guild (:ref:`GUILD`) and discord.User (:ref:`USER`)
16+
- Added ``.update`` method to some objects for allowing dynamic modifications of initialization parameters.
17+
- :ref:`AUDIO` now also accepts a YouTube link for streaming YouTube videos.
18+
- New :ref:`Exceptions` system - most functions now raise exceptions instead of just returning bool to allow better detection of errors.
19+
- Bug fixes and other small improvements.
20+
21+
v1.9.0
22+
----------------------
23+
- Added support for logging into a SQL database (MS SQL Server only). See :ref:`relational database log`.
24+
- :ref:`run` function now accepts discord.Intents.
25+
- :ref:`add_object` and :ref:`remove_object` functions created to allow for dynamic modification of the shilling list.
26+
- Other small improvements.
27+
28+
v1.8.1
29+
----------------------
30+
- JSON file logging.
31+
- Automatic channel removal if channel get's deleted and message removal if all channels are removed.
32+
- Improved debug messages.
33+
34+
v1.7.9
35+
----------------------
36+
- :ref:`DirectMESSAGE` and :ref:`user` classes created for direct messaging.
37+
38+
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
=====================
2+
Classes
3+
=====================
4+
This page contains information about any classes that can be used in the framework.
5+
6+
7+
Guilds (Servers)
8+
---------------------
9+
10+
GUILD
11+
~~~~~~~~~~~~~~~~~~~~~
12+
.. autoclass:: framework.GUILD
13+
:members:
14+
15+
.. autoproperty:: messages
16+
17+
.. autoproperty:: snowflake
18+
19+
USER
20+
~~~~~~~~~~~~~~~~~~~~~
21+
.. autoclass:: framework.USER
22+
:members:
23+
24+
.. autoproperty:: messages
25+
26+
.. autoproperty:: snowflake
27+
28+
29+
30+
Messages
31+
---------------------
32+
33+
TextMESSAGE
34+
~~~~~~~~~~~~~~~~~~~~~~~~~
35+
.. autoclass:: framework.TextMESSAGE
36+
:members:
37+
38+
.. autoproperty:: deleted
39+
40+
VoiceMESSAGE
41+
~~~~~~~~~~~~~~~~~~~~~~~~~
42+
.. autoclass:: framework.VoiceMESSAGE
43+
:members:
44+
45+
.. autoproperty:: deleted
46+
47+
DirectMESSAGE
48+
~~~~~~~~~~~~~~~~~~~~~~~~~
49+
.. autoclass:: framework.DirectMESSAGE
50+
:members:
51+
52+
.. autoproperty:: deleted
53+
54+
55+
56+
57+
Message data types
58+
---------------------
59+
These classes describe data that can be passed to the :ref:`Messages` objects
60+
61+
EMBED
62+
~~~~~~~~~~~~~~~~~~~~~~~~~
63+
.. autoclass:: framework.EMBED
64+
:members:
65+
:exclude-members: Color, Colour
66+
67+
FILE
68+
~~~~~~~~~~~~~~~~~~~~~~~~~
69+
.. autoclass:: framework.FILE
70+
:members:
71+
72+
AUDIO
73+
~~~~~~~~~~~~~~~~~~~~~~~~~
74+
.. autoclass:: framework.AUDIO
75+
:members:
76+
77+
78+
79+
80+
Clients
81+
---------------------
82+
83+
CLIENT
84+
~~~~~~~~~~~~~~~~~~~~~~~~~
85+
.. autoclass:: framework.CLIENT
86+
:members:
87+
88+
89+
SQL
90+
---------------------
91+
92+
LoggerSQL
93+
~~~~~~~~~~~~~~~~~~~~~~~~~
94+
.. note::
95+
See :ref:`Relational Database Log` for usage.
96+
97+
.. autoclass:: framework.LoggerSQL
98+
:members:
99+
:exclude-members: Base
100+
101+
102+
103+
104+
Tracing
105+
---------------------
106+
107+
TraceLEVELS
108+
~~~~~~~~~~~~~~~~~~~~~~~~~
109+
.. autoenum:: framework.TraceLEVELS
110+
:members:
111+
112+
113+
Exceptions
114+
---------------------
115+
116+
Types
117+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118+
**DAFError**
119+
120+
.. autoclass:: framework.DAFError
121+
:members:
122+
123+
**DAFSQLError**
124+
125+
.. autoclass:: framework.DAFSQLError
126+
:members:
127+
128+
129+
**DAFNotFoundError**
130+
131+
.. autoclass:: framework.DAFNotFoundError
132+
:members:
133+
134+
**DAFParameterError**
135+
136+
.. autoclass:: framework.DAFParameterError
137+
:members:
138+
139+
140+
Error codes
141+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142+
.. table::
143+
:align: left
144+
:name: error_codes
145+
146+
+----------------------------------------+------+----------------------------------------------------------------------------+
147+
| Name | Code | Description |
148+
+----------------------------------------+------+----------------------------------------------------------------------------+
149+
| DAF_GUILD_ALREADY_ADDED | 0 | Guild with specified snowflake is already added. |
150+
+----------------------------------------+------+----------------------------------------------------------------------------+
151+
| DAF_GUILD_ID_REQUIRED | 1 | Guild ID is required but was not passed. |
152+
+----------------------------------------+------+----------------------------------------------------------------------------+
153+
| DAF_GUILD_ID_NOT_FOUND | 2 | Guild with specified snowflake was not found (or user). |
154+
+----------------------------------------+------+----------------------------------------------------------------------------+
155+
| DAF_USER_CREATE_DM | 3 | Was unable to create DM with user (probably user not found). |
156+
+----------------------------------------+------+----------------------------------------------------------------------------+
157+
| DAF_INVALID_TYPE | 4 | Object of invalid type was given. |
158+
+----------------------------------------+------+----------------------------------------------------------------------------+
159+
| DAF_YOUTUBE_STREAM_ERROR | 5 | The given youtube link could not be streamed (AUDIO, VoiceMESSAGE). |
160+
+----------------------------------------+------+----------------------------------------------------------------------------+
161+
| DAF_FILE_NOT_FOUND | 6 | The given file was not found. |
162+
+----------------------------------------+------+----------------------------------------------------------------------------+
163+
| DAF_UPDATE_PARAMETER_ERROR | 7 | The update method only accepts the following keyword arguments. |
164+
+----------------------------------------+------+----------------------------------------------------------------------------+
165+
| DAF_MISSING_PARAMETER | 8 | The parameter(s) is(are) missing. |
166+
+----------------------------------------+------+----------------------------------------------------------------------------+
167+
| DAF_SQL_CREATE_TABLES_ERROR | 9 | Unable to create all the tables. |
168+
+----------------------------------------+------+----------------------------------------------------------------------------+
169+
| DAF_SQL_LOOKUPTABLE_NOT_FOUND | 10 | The lookup table was not found. |
170+
+----------------------------------------+------+----------------------------------------------------------------------------+
171+
| DAF_SQL_BEGIN_ENGINE_ERROR | 11 | Unable to start engine. |
172+
+----------------------------------------+------+----------------------------------------------------------------------------+
173+
| DAF_SQL_CR_LT_VALUES_ERROR | 12 | Unable to create lookuptables' rows. |
174+
+----------------------------------------+------+----------------------------------------------------------------------------+
175+
| DAF_SQL_CREATE_DT_ERROR | 13 | Unable to create SQL data types. |
176+
+----------------------------------------+------+----------------------------------------------------------------------------+
177+
| DAF_SQL_CREATE_VPF_ERROR | 14 | Unable to create views, procedures and functions. |
178+
+----------------------------------------+------+----------------------------------------------------------------------------+
179+
| DAF_SQL_CURSOR_CONN_ERROR | 15 | Unable to connect the cursor. |
180+
+----------------------------------------+------+----------------------------------------------------------------------------+
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
Functions
2+
======================
3+
This page contains information about any functions that can be called.
4+
5+
6+
7+
add_object
8+
--------------------------
9+
.. function:: framework.add_object(obj: Union[USER, GUILD])
10+
:noindex:
11+
12+
Adds a guild or an user to the framework.
13+
14+
:Parameters:
15+
- obj: Union[:ref:`USER`, :ref:`GUILD`] -
16+
The guild object to add into the framework.
17+
18+
:Raises:
19+
- DAFParameterError(code=DAF_GUILD_ALREADY_ADDED) -
20+
The guild/user is already added to the framework.
21+
- DAFParameterError(code=DAF_INVALID_TYPE) -
22+
The object provided is not supported for addition.
23+
- Other -
24+
Raised in the :ref:`Guilds (Servers)` ``.add_message()`` method
25+
26+
.. function:: framework.add_object(obj: Union[DirectMESSAGE, TextMESSAGE, VoiceMESSAGE], snowflake: Union[int, GUILD, USER, dc.Guild, dc.User])
27+
28+
Adds a message to the framework.
29+
30+
:Parameters:
31+
obj: Union[:ref:`DirectMESSAGE`, :ref:`TextMESSAGE`, :ref:`VoiceMESSAGE`]
32+
The message object to add into the framework.
33+
snowflake: Union[int, :ref:`GUILD`, :ref:`USER`, dc.Guild, dc.User]
34+
Which guild/user to add it to (can be snowflake id or a framework _BaseGUILD object or a discord API wrapper object).
35+
36+
:Raises:
37+
DAFParameterError(code=DAF_GUILD_ID_REQUIRED)
38+
guild_id wasn't provided when adding a message object (to which guild should it add)
39+
DAFNotFoundError(code=DAF_GUILD_ID_NOT_FOUND)
40+
Could not find guild with that id.
41+
DAFParameterError(code=DAF_INVALID_TYPE)
42+
The object provided is not supported for addition.
43+
Other
44+
Raised in the :ref:`Guilds (Servers)` ``.add_message()`` method
45+
46+
remove_object
47+
--------------------------
48+
.. function:: framework.remove_object(guild_id: int)
49+
:noindex:
50+
:async:
51+
52+
Removes a guild from the framework that has the given guild_id.
53+
54+
:Parameters:
55+
guild_id: int
56+
ID of the guild to remove.
57+
58+
:Raises:
59+
- DAFNotFoundError(code=DAF_GUILD_ID_NOT_FOUND)
60+
Could not find guild with that id.
61+
- DAFParameterError(code=DAF_INVALID_TYPE)
62+
The object provided is not supported for removal.
63+
64+
65+
66+
.. function:: framework.remove_object(channel_ids: Iterable[int])
67+
:async:
68+
69+
Removes messages that contain all the given channel ids.
70+
71+
:Parameters:
72+
channel_ids: Iterable[int]
73+
The channel IDs that the message must have to be removed (it must have all of these).
74+
75+
:Raises:
76+
DAFParameterError(code=DAF_INVALID_TYPE)
77+
The object provided is not supported for removal.
78+
79+
80+
81+
data_function
82+
--------------------------
83+
.. autofunction:: framework.data_function
84+
85+
86+
get_client
87+
--------------------------
88+
.. autofunction:: framework.get_client
89+
90+
91+
get_sql_manager
92+
--------------------------
93+
.. autofunction:: framework.get_sql_manager
94+
95+
96+
run
97+
--------------------------
98+
.. autofunction:: framework.run
99+
100+
101+
shutdown
102+
--------------------------
103+
.. autofunction:: framework.shutdown
104+
105+
106+
trace
107+
--------------------------
108+
.. autofunction:: framework.trace
109+
110+

0 commit comments

Comments
 (0)