Skip to content

Commit 1d69074

Browse files
authored
Merge pull request #46 from A-Baji/dev
DiscordAI 3.0.0
2 parents 7e5f914 + 3cc2490 commit 1d69074

31 files changed

+3606
-842
lines changed

.coveragerc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[run]
2+
omit =
3+
*/bot/*
4+
5+
[report]
6+
exclude_lines =
7+
if __name__ == "__main__":
8+
except KeyboardInterrupt:

.github/workflows/package.yml

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,31 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
py_ver:
16-
- '3.8'
1716
- '3.9'
1817
- '3.10'
1918
- '3.11'
19+
- '3.12'
2020
steps:
2121
- uses: actions/checkout@v3
22+
with:
23+
submodules: 'true'
2224
- uses: actions/setup-python@v4
2325
with:
24-
python-version: ${{matrix.py_ver}}
26+
python-version: ${{ matrix.py_ver }}
2527
- name: Install Package
2628
run: pip install .
2729
- name: Test Package
28-
run: echo -e "none\nnone" | discordai -V
30+
env:
31+
PY_VER: ${{ matrix.py_ver }}
32+
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_BOT_TOKEN }}
33+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
34+
CHANNEL_ID: ${{ secrets.CHANNEL_ID }}
35+
USERNAME: ${{ secrets.USERNAME }}
36+
PYTHONUNBUFFERED: 1
37+
run: |
38+
touch .env.test
39+
export VERSION=$(cat discordai/version.py | grep -oP '\d+\.\d+\.\d+')
40+
docker compose -f docker-compose-test.yaml up --build --exit-code-from tests
2941
release:
3042
if: |
3143
github.event_name == 'push' &&
@@ -41,11 +53,11 @@ jobs:
4153
- name: Create release
4254
uses: actions/create-release@v1
4355
env:
44-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4557
with:
46-
tag_name: ${{steps.version.outputs.discordai_version}}
47-
release_name: Release ${{steps.version.outputs.discordai_version}}
48-
body: Release ${{steps.version.outputs.discordai_version}}
58+
tag_name: ${{ steps.version.outputs.discordai_version }}
59+
release_name: Release ${{ steps.version.outputs.discordai_version }}
60+
body: Release ${{ steps.version.outputs.discordai_version }}
4961
draft: false
5062
prerelease: false
5163
package:
@@ -62,25 +74,25 @@ jobs:
6274
- uses: actions/checkout@v3
6375
- uses: actions/setup-python@v4
6476
with:
65-
python-version: '3.11'
77+
python-version: '3.12'
6678
- name: Install Dependencies
67-
run: pip install . pyinstaller==5.7
79+
run: pip install . pyinstaller
6880
# Package
6981
- name: Windows CLI Package
70-
if: ${{matrix.os == 'windows-latest'}}
82+
if: ${{ matrix.os == 'windows-latest' }}
7183
run: |
72-
pyinstaller discordai/command_line.py --console --onefile --name=discordai --add-binary='discordai/bot/cogs;discordai/bot/cogs' --hidden-import=openai --hidden-import=tiktoken --collect-data=discordai_modelizer
84+
pyinstaller discordai/command_line/command_line.py --console --onefile --name=discordai --add-binary='discordai/bot/cogs;discordai/bot/cogs' --hidden-import=openai --collect-data=discordai_modelizer
7385
Compress-Archive -Path dist\*discordai* -DestinationPath discordai-windows.zip
7486
- name: Mac CLI Package
75-
if: ${{matrix.os == 'macos-latest'}}
87+
if: ${{ matrix.os == 'macos-latest' }}
7688
run: |
77-
pyinstaller discordai/command_line.py --console --onefile --name=discordai --add-data='discordai/bot/cogs:discordai/bot/cogs' --hidden-import=openai --hidden-import=tiktoken --hidden-import=configparser --collect-data=discordai_modelizer --collect-data=aiohttp --collect-data=certifi
89+
pyinstaller discordai/command_line/command_line.py --console --onefile --name=discordai --add-data='discordai/bot/cogs:discordai/bot/cogs' --hidden-import=openai --hidden-import=configparser --collect-data=discordai_modelizer --collect-data=aiohttp --collect-data=certifi
7890
zip -j discordai-macos.zip dist/*discordai*
7991
chmod +x dist/*discordai*
8092
- name: Linux CLI Package
81-
if: ${{matrix.os == 'ubuntu-latest'}}
93+
if: ${{ matrix.os == 'ubuntu-latest' }}
8294
run: |
83-
pyinstaller discordai/command_line.py --console --onefile --name=discordai --add-binary='discordai/bot/cogs:discordai/bot/cogs' --hidden-import=openai --hidden-import=tiktoken --collect-data=discordai_modelizer
95+
pyinstaller discordai/command_line/command_line.py --console --onefile --name=discordai --add-binary='discordai/bot/cogs:discordai/bot/cogs' --hidden-import=openai --collect-data=discordai_modelizer
8496
zip -j discordai-linux.zip dist/*discordai*
8597
chmod +x dist/*discordai*
8698
# Upload

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ discordai/bot/cogs/*.py
77
!discordai/bot/cogs/chatgpt.py
88
!discordai/bot/cogs/sync.py
99
init.sh
10+
/files/
1011

1112
# Byte-compiled / optimized / DLL files
1213
__pycache__/
@@ -115,6 +116,7 @@ celerybeat.pid
115116
*.sage.py
116117

117118
# Environments
119+
/*.env*
118120
.env
119121
.venv
120122
env/

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "discordAI-modelizer"]
2+
path = discordAI-modelizer
3+
url = https://github.com/A-Baji/discordAI-modelizer.git
4+
branch = dev

CHANGELOG.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
22

33
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
44

5+
## [3.0.0] - 07-xx-2024
6+
7+
### Added
8+
9+
- support for python 3.12
10+
- unit tests
11+
12+
### Changed
13+
14+
- updated modelizer to version [3.0.9](https://github.com/A-Baji/discordAI-modelizer/releases/tag/3.0.9)
15+
- updated and pinned openai to version 1.35.5
16+
- includes various updates to the included slash commands
17+
- updated DiscordChatExporter to version 2.43.3
18+
- refactor/optimization/general cleanup of code
19+
- improved dev environment
20+
- updated some cli args
21+
- updated some cli help strings
22+
- updated config handling
23+
24+
### Removed
25+
26+
- support for python 3.8
27+
- token usage tracking for /chatgpt command
28+
529
## [2.0.1] - 06-15-2023
630

731
### Changed
@@ -14,7 +38,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
1438
### Added
1539

1640
- a changelog
17-
- an openAI image generation command
41+
- an OpenAI image generation command
1842
- the gpt3.5 model to the openai command and made it the default
1943
- a chatGPT command with chat history functionality
2044
- custom emoji support for custom models.
@@ -26,7 +50,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
2650

2751
### Changed
2852

29-
- made prompt bolding for custom model completions a discord command parameter
53+
- made prompt bolding for custom model completions a Discord command parameter
3054
- updated modelizer to version [2.0.0](https://github.com/A-Baji/discordAI-modelizer/releases/tag/2.0.0)
3155

3256
## [1.3.2] - 02-22-2023
@@ -82,6 +106,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
82106

83107
- modified readme
84108

109+
[3.0.0]: https://github.com/A-Baji/discordAI/compare/2.0.1...3.0.0
85110
[2.0.1]: https://github.com/A-Baji/discordAI/compare/1.3.2...2.0.1
86111
[2.0.0]: https://github.com/A-Baji/discordAI/compare/1.3.2...2.0.0
87112
[1.3.2]: https://github.com/A-Baji/discordAI/compare/1.3.1...1.3.2

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
FROM python:3.11-alpine
1+
ARG PY_VER
2+
FROM python:${PY_VER}
23
WORKDIR /main
3-
RUN apk update
4-
RUN apk add git
54
COPY ./requirements.txt ./setup.py ./README.md /main/
65
COPY ./discordai /main/discordai
76
RUN pip3 install --upgrade pip

0 commit comments

Comments
 (0)