Commit Graph

600 Commits

Author SHA1 Message Date
3a955d4379 🐛 fix(main.py): handle on_application_command_error with proper error handling and response
 feat(main.py): add ChatProcess module for handling chat-related functionality
🔧 refactor(main.py): import necessary modules and update bot.add_cog calls
🔧 refactor(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics
 feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port
🔧 refactor(cogs/__init__.py): import ChannelSetup cog
 feat(cogs/channelSetup.py): add ChannelSetup cog for setting up channels and server-wide settings
🔧 refactor(cogs/setup.py): import SlashCommandGroup and guild_only from discord module
 feat(cogs/setup.py): add setup_channel command for adding and removing channels
 feat(cogs/setup.py): add api command for setting API keys
 feat(cogs/setup.py): add premium command for setting guild to premium
🔧 refactor(cogs/settings.py): temporarily disable images command due to maintenance
🔧 refactor(config.py): remove unnecessary code related to moderation table
 feat(guild.py): add Guild class for managing guild-specific data and settings
 feat(SqlConnector.py): add SQLConnection and _sql classes for managing SQLite connections
 feat(variousclasses.py): add models, characters, and apis classes for autocomplete functionality in slash commands
2023-08-19 14:16:30 +02:00
f5e5145b14 🔧 chore(docker-publish.yml): remove scheduled job for Docker workflow
🔧 chore(docker-publish.yml): remove scheduled job for Docker workflow to simplify the workflow and avoid unnecessary executions
2023-08-17 17:43:11 +02:00
c8997ab418 🎨 chore(*): run black to format the code 2023-08-16 09:46:28 +02:00
ee825be892 🐛 fix(makeprompt.py): import Hasher class from src.utils.misc to resolve NameError
🔒 chore(makeprompt.py): add user hashing to prevent abuse and enable user banning if necessary
2023-08-16 09:44:01 +02:00
a02bfb5cbc 🐛 fix(makeprompt.py): await the moderate function call to properly handle moderation before increasing depth 2023-08-16 09:31:00 +02:00
9f257b4126 🐛 fix(makeprompt.py): import ModerationError from src.utils.misc to handle moderation errors in chatgpt_process function
🐛 fix(makeprompt.py): raise ModerationError with message "Too many recursive messages" when answering recursively in chatgpt_process function
2023-08-16 09:26:03 +02:00
fa3eb3da0a 🐛 fix(functionscalls.py): await the moderate function calls to properly handle asynchronous moderation checks 2023-08-16 09:25:43 +02:00
7c21934bc0 🔀 chore(functionscalls.py): update import statement for the 'moderate' function to reflect the correct file path
🔀 chore(functionscalls.py): update import statement for the 'tenor_api_key' variable to reflect the correct file path
2023-08-16 09:22:31 +02:00
303d3c07ac 🐛 fix(chat.py): fix typo in message.channel.send() method call
🔒 chore(chat.py): add moderation check for message content in call_function() to prevent sending blocked messages
🔒 chore(chat.py): add moderation check for query in call_function() to prevent sending blocked queries
🔒 chore(makeprompt.py): add moderation check for content in chatgpt_process() to prevent sending blocked content
🔒 chore(makeprompt.py): add depth check to prevent recursive answering in chatgpt_process()
2023-08-16 09:20:29 +02:00
d520b8b87c 🐛 fix(chat.py): add missing import statement for asyncio module
🐛 fix(chat.py): fix import statement for banusr module
 feat(chat.py): add functionality to ban and unban users with botator!ban and botator!unban commands
 feat(chat.py): add functionality to send messages from banned users after a delay
 feat(banusr.py): create banusr module to handle banning and unbanning of users
 feat(banusr.py): add functionality to ban a user by appending their ID to banend_users list
 feat(banusr.py): add functionality to unban a user by removing their ID from banend_users list
2023-08-15 19:20:12 +02:00
f2e1b2ffe3 🔧 chore(makeprompt.py): refactor prepare_messages and chatgpt_process functions to accept an error_call function for error handling
🔧 chore(makeprompt.py): refactor chat_process function to use the error_call function for error handling
2023-08-15 18:53:22 +02:00
df3e01900e 🐛 fix(functionscalls.py): reformat code for better readability and maintainability 2023-08-15 18:50:25 +02:00
30ef28ce49 🐛 fix(functionscalls.py): add timeout parameter to evaluate_math function to limit execution time and prevent potential abuse or infinite loops 2023-08-15 18:49:51 +02:00
d057fc7a78 🎨 chore(*): run black to format the code 2023-08-15 14:22:05 +02:00
be771f7c22 🐛 fix(makeprompt.py): add missing 'depth' parameter to recursive function call to prevent infinite recursion 2023-08-15 14:15:57 +02:00
f79bdd2086 🐛 fix(makeprompt.py): import FuntionCallError from src.functionscalls to fix NameError
 feat(makeprompt.py): add depth parameter to chatgpt_process function to limit recursive function calls and raise FuntionCallError if exceeded
2023-08-15 14:15:35 +02:00
4b8070b413 🔧 chore(requirements.txt): add 'simpleeval' package for math expression evaluation
🔧 chore(functionscalls.py): add 'evaluate_math' function to evaluate math expressions
🔧 chore(makeprompt.py): refactor 'chatgpt_process' to use 'prepare_messages' function for message preparation
2023-08-15 14:11:21 +02:00
6de23a1a33 🔇 chore(makeprompt.py): remove debug print statements for messages and response variables 2023-08-15 12:48:00 +02:00
277c733bac 📦 chore(requirements.txt): add orjson library for improved speed in JSON processing 2023-08-15 12:46:48 +02:00
7bc5f03e14 🔧 fix(functionscalls.py): fix typo in FunctionCallError class name
 feat(functionscalls.py): add call_function function to handle function calls with name and arguments
🔧 fix(makeprompt.py): remove individual function imports from functionscalls and use call_function instead
2023-08-15 12:42:18 +02:00
88d65e9f79 🎨 chore(*): run black to format the code 2023-08-15 12:38:47 +02:00
456e147785 🐛 fix(functionscalls.py): fix typo in FunctionCallError class name
 feat(functionscalls.py): add error handling for missing arguments in function calls
🐛 fix(makeprompt.py): fix typo in function_call variable name
🔀 chore(gpt-3.5-turbo.txt): update instructions to only use provided functions
2023-08-15 12:38:37 +02:00
68ff639f27 🐛 fix(makeprompt.py): reverse the order of fetched messages to ensure correct chronological order
🔥 chore(makeprompt.py): remove unnecessary oldest_first parameter in channel.history() calls
2023-08-15 11:33:29 +02:00
1e8eaf5ae0 🔧 chore(moderation.py): comment out unfinished ban command to prevent errors during development
🔧 chore(moderation.py): import commands from discord.ext to fix missing reference error
2023-08-15 11:23:52 +02:00
737db1aead 🐛 fix(config.py): fix the path to the gpt-3.5-turbo.txt file by using os.path.join instead of os.path.abspath and os.path.dirname 2023-08-15 11:10:12 +02:00
cc5fd3aa7a 🐛 fix(makeprompt.py): refactor condition to check if message is ignorable using a separate function for better readability and maintainability 2023-08-15 11:05:52 +02:00
f04a04801b 🎨 chore(*): run black to format the code 2023-08-15 11:04:33 +02:00
8486453d18 🐛 fix(makeprompt.py): refactor message history fetching logic into a separate function for better code organization and reusability
 feat(makeprompt.py): add `is_ignorable` function to check if a message content is ignorable based on certain conditions
 feat(makeprompt.py): add `fetch_messages_history` function to fetch message history from a channel with optional limit and original message parameters
2023-08-15 11:03:23 +02:00
f0f160429d 🔥 refactor(makeprompt.py): remove unnecessary code that deletes the message after sending an embed 2023-08-15 10:50:10 +02:00
52ad105e06 🐛 fix(makeprompt.py): fix prompt generation logic for DM channels
 feat(makeprompt.py): add support for generating prompt with server and channel names, date and time, and pretend-to-be value
2023-08-15 10:46:54 +02:00
b139e40f8a 🐛 fix(config.py): add missing newline at the end of the file
🐛 fix(makeprompt.py): remove unnecessary file close statement after reading prompt file
 feat(config.py): add gpt_3_5_turbo_prompt variable to store the content of the prompt file
 feat(makeprompt.py): use gpt_3_5_turbo_prompt variable instead of reading the prompt file again
2023-08-15 10:44:13 +02:00
553d259bc7 🐛 fix(makeprompt.py): change condition to check if the message is from the bot user by comparing author id to improve accuracy
🔥 chore(makeprompt.py): remove unnecessary comment about ignoring messages from bots
🔥 chore(makeprompt.py): remove unnecessary comment about ignoring messages from guild or dm channel not in the database
2023-08-15 10:41:16 +02:00
1b02f27f41 📦 chore(requirements.txt): update disco.oauth2 package to discord-oauth2.py for compatibility 2023-08-15 00:27:08 +02:00
b0f4b4aa55 📦 chore(requirements.txt): add black to the list of dependencies for code formatting consistency 2023-08-14 23:43:15 +02:00
eb20e06700 📦 chore(requirements.txt): add 'disco.oauth2' package to the requirements 2023-08-14 23:40:33 +02:00
cc83447a39 🔧 chore(.gitignore): add '*.ovpn' and 'tests/' to the list of ignored files and directories 2023-08-14 23:24:32 +02:00
f0e8a37a7f 🔥 chore(test-google-vision.py): remove unused code and dependencies
The test-google-vision.py file was deleted as it contained unused code and dependencies that were no longer needed.
2023-08-14 23:24:01 +02:00
Paillat
b4dc56d97f 📐 improve(*): run black to format the code 2023-08-03 14:01:49 +02:00
Paillat
c9ecf54bf4 test formatting 2023-08-03 14:01:35 +02:00
Paillat
0e22a01310 ­ƒøá´©Å chore(format): run black to format the code 2023-08-03 13:58:44 +02:00
Paillat
33082e860b Merge branch 'main' of https://github.com/Paillat-dev/Botator 2023-08-03 13:54:54 +02:00
9324785ee1 Delete opencommit.yml 2023-08-03 13:32:03 +02:00
Paillat
0e7f8948a6 🔀 refactor(functionscalls.py): update import statement for tenor_api_key to use absolute path for better module resolution 2023-08-03 11:31:30 +00:00
Paillat
318d0d568e chore(functionscalls.py): fix import statement for tenor_api_key to use absolute path for better module resolution 2023-08-03 13:31:06 +02:00
Paillat
8bb99a4ee9 🔧 chore(opencommit.yml): enable emoji support in OpenCommit workflow for more expressive commit messages
🗑️ delete(gpt-4.txt): remove unused file containing prompts for Botator, as it is no longer needed
2023-08-03 11:15:20 +00:00
Paillat
5318bda74c 🔧 chore(openaicaller.py): remove unnecessary blank line to improve code readability 2023-08-03 11:15:20 +00:00
Paillat
3a92aafe9a feat(opencommit.yml): enable emoji support in OpenCommit workflow to enhance commit message formatting
🔥 chore(gpt-4.txt): remove gpt-4.txt prompt file as it is no longer needed
2023-08-03 11:15:20 +00:00
Paillat
762570d2c6 chore(opencommit.yml): update OpenCommit workflow configuration
This commit updates the OpenCommit workflow configuration in the `.github/workflows/opencommit.yml` file. The changes include:

- Ignoring certain branches (`main`, `master`, `dev`, `development`, `release`) for triggering the workflow.
- Setting up the Node.js environment with Node.js version 16.
- Checking out the repository with a fetch depth of 0.
- Using the `di-sukharev/opencommit@github-action-v1.0.4` action for running the OpenCommit process.
- Providing the necessary environment variables, including the GitHub token and OpenAI API key.
- Customizing the OpenCommit behavior with the following options:
  - Maximum tokens: 500
  - Base path: ''
  - Description: false
  - Emoji: false
  - Model: gpt-3.5-turbo
  - Language: en
2023-08-02 21:29:17 +02:00
Paillat
800c86bd99 chore(opencommit.yml): add GitHub Actions workflow file for OpenCommit project 2023-08-02 21:24:28 +02:00
Paillat
5d6c07aea7 chore(gpt-3.5-turbo.txt): add website link to the prompt for reference 2023-08-02 21:22:21 +02:00