Skip to content

Commit 42ebf8a

Browse files
authored
Version bump, linting, refactoring (#138)
* Version bump, TODO, linting * Smaller Improvements
1 parent 961c341 commit 42ebf8a

File tree

17 files changed

+233
-229
lines changed

17 files changed

+233
-229
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
- warning
1717
- debug
1818

19-
jobs:
19+
jobs:
2020
upload:
2121
runs-on: ubuntu-latest
2222

@@ -32,19 +32,5 @@ jobs:
3232
- name: build
3333
working-directory: docs
3434
run: make clean html
35-
3635

37-
- name: GitHub Pages
38-
# You may pin to the exact commit or the version.
39-
# uses: crazy-max/ghaction-github-pages@eb08c35b9fab86751edfff4e55cd5cde35ff0e52
40-
uses: crazy-max/[email protected]
41-
with:
42-
# Git domain (default github.com)
43-
#domain: # optional, default is github.com
44-
# Git branch where assets will be deployed
45-
#target_branch: # optional, default is gh-pages
46-
# Create incremental commit instead of doing push force
47-
# Build directory to deploy
48-
build_dir: docs/build/html
49-
# Allow Jekyll to build your site
50-
jekyll: False
36+
# TODO: Upload to FTP

Examples/Message Types/VoiceMESSAGE/main_data_function.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def get_data(param1, param2):
2121
# If start period is defined, it dictates the maximum limit of randomized period
2222
data=get_data(1, 2), # Data parameter
2323
channels=[123456789], # List of channel ids or discord.VoiceChannel objects
24+
volume=50, # The volume (0-100%) at which to play the audio
2425
start_now=True # Start sending now (True) or wait until period
2526
),
2627
],

Examples/Message Types/VoiceMESSAGE/main_stream_audio.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# If start period is defined, it dictates the maximum limit of randomized period
1515
data=some_audio_file, # Data parameter
1616
channels=[123456789], # List of channel ids or discord.VoiceChannel objects
17+
volume=50, # The volume (0-100%) at which to play the audio
1718
start_now=True # Start sending now (True) or wait until period
1819
),
1920
],

docs/source/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Changelog
77
The library first started as a single file script that I didn't make versions of.
88
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.
99

10-
v1.9.5
10+
v2.0
1111
----------------------
1212
- New cool looking web documentation (the one you're reading now)
1313
- Added volume parameter to :ref:`VoiceMESSAGE`

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
project = 'Discord Advert Framework'
2323
copyright = '2022, David Hozic'
2424
author = 'David Hozic'
25-
version = ""
25+
version = "v2.0.0"
2626

2727
with open("../../src/framework/__init__.py", "r", encoding="utf-8") as init_file:
2828
match = re.search(r"(?<=\|).*Version.*(?=\|)", init_file.read())

docs/source/index.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ DAF (|version|)
33
=========================================================
44
The Discord advertisement framework is a **shilling tool** that allows easy advertising on Discord.
55

6-
.. warning::
7-
**Version v1.9.5 is not yet released** or even ready. The **latest version is v1.9**.
8-
9-
Anything that has a **"Changed in v1.9.5"** or **"Added in v1.9.5"** is **not yet available**!
10-
116

127
Links
138
----------------------

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
__metadata__ = \
1414
{
15-
"version" : "1.9.2",
15+
"version" : "2.0.0",
1616
"requirements" : req,
1717
"minimum_py_version" : "3.8",
1818
}

src/framework/__init__.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
"""
2-
==============================================
3-
DISCORD ADVERTISEMENT FRAMEWORK (DAF)
4-
==============================================
5-
+----------+-----------------------------------+
6-
| Author | David Hozic |
7-
| Copyright| Copyright (c) 2022 David Hozic |
8-
| Version | v1.9.5 |
9-
+----------+-----------------------------------+
2+
Discord Advertisement Framework
3+
4+
Version 2.0
105
"""
116
import _discord as discord
127
from .client import *
@@ -17,9 +12,4 @@
1712
from .message import *
1813
from .tracing import *
1914
from .sql import *
20-
from .exceptions import *
21-
22-
#-----------------
23-
# TODO:
24-
#-----------------
25-
# Update Examples
15+
from .exceptions import *

src/framework/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def remove_object(data):
239239

240240
async def _update(obj: Any, *, init_options: dict = {}, **kwargs):
241241
"""
242-
.. versionadded:: v1.9.5
242+
.. versionadded:: v2.0
243243
244244
Used for changing the initialization parameters the obj was initialized with.
245245
@@ -344,11 +344,11 @@ def run(token : str,
344344
"""
345345

346346
guild.GLOBALS.server_log_path = server_log_output # Logging folder
347-
tracing.m_use_debug = debug # Print trace messages to the console for debugging purposes
348347
GLOBALS.temp_server_list = server_list # List of guild objects to iterate thru in the advertiser task
349348
GLOBALS.sql_manager = sql_manager # SQL manager object
350349
GLOBALS.is_user = is_user # Is the token from an user account
351350
if user_callback is not None:
352351
GLOBALS.user_callback = user_callback() # Called after framework has started
353-
352+
353+
tracing.initialize(debug) # Print trace messages to the console for debugging purposes
354354
client._initialize(token, bot=not is_user, intents=intents)

src/framework/dtypes.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,13 @@ def __init__(self, filename: str) -> None:
257257
except FileNotFoundError:
258258
raise DAFNotFoundError(f"The file {self.url} could not be found.", DAF_FILE_NOT_FOUND)
259259

260-
261-
@property
262-
def filename(self):
260+
def to_dict(self):
263261
"""
264-
Returns the filename of the file or the name of a youtube video with the link
262+
Returns dictionary representation of this data type.
263+
264+
.. versionchanged:: v2.0
265+
266+
Changed to method ``to_dict`` from property ``filename``
265267
"""
266268
if self.stream:
267269
return {

0 commit comments

Comments
 (0)