You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+122-4Lines changed: 122 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,128 @@
3
3
# Copilot Instructions
4
4
5
5
## Overview
6
-
This project is a [Discord](https://discord.com/) Bot developed in Java, utilizing [JDA (Java Discord API)](https://jda.wiki/introduction/jda/) library for diverse interactions on Together Java server. The project is built with Gradle.
6
+
This project is a [Discord](https://discord.com/) Bot developed in Java, utilizing [JDA (Java Discord API)](https://jda.wiki/introduction/jda/) library for diverse interactions on Together Java discord server.
7
+
8
+
## Tech Stack
9
+
10
+
The project uses a variety of technologies and libraries to achieve its functionality. Below is a comprehensive list of the main technologies used :
11
+
12
+
**Languages**
13
+
- Java: the primary language for the project.
14
+
- SQL: for database creation and management.
15
+
- Groovy: for build-tool's configurations.
16
+
17
+
**Build & Dependency Management**
18
+
- Gradle v8: the build tool used for managing dependencies and building the project.
19
+
- Shadow plugin: for creating a fat JAR with all dependencies included.
20
+
- Jib plugin: for building Docker images directly from Gradle.
21
+
22
+
**Framework :** JDA (Java Discord API): the main framework for interacting with Discord's API.
23
+
24
+
**Database**
25
+
- SQLite: for local database storage.
26
+
- jOOQ (ORM): for database interactions and schema generation.
27
+
28
+
**Logging**
29
+
- Log4j v2: the logging framework used for logging messages.
30
+
- log4j-slf4j2-impl: for bridging SLF4J to Log4j v2.
31
+
32
+
**JSON/XML/CSV Processing**
33
+
- Jackson (core, dataformat-csv, dataformat-xml, datatype-jsr310, sealed-classes)
34
+
35
+
**Utilities**
36
+
- jsr305: for annotations from JSR-305.
37
+
- JetBrains Annotations: for annotations from JetBrains.
38
+
- urlbuilder: for building URLs.
39
+
- jsoup: for parsing HTML and extracting data.
40
+
- jlatexmath (+ font modules): for rendering LaTeX math expressions.
41
+
- ascii-table: for rendering ASCII tables.
42
+
- url-detector
43
+
- caffeine (caching)
44
+
- github-api (kohsuke)
45
+
- commons-text
46
+
- rssreader
47
+
- com.theokanning.openai-gpt3-java (api, service)
48
+
49
+
**Testing**
50
+
- JUnit Jupiter
51
+
- Mockito
52
+
53
+
**Code Quality**
54
+
- Spotless
55
+
- SonarLint
56
+
57
+
**Containerization**
58
+
- Docker Compose
59
+
- Jib (for container image building)
60
+
61
+
**Version Control & CI/CD**
62
+
- Git v2
63
+
- GitHub Actions (for CI/CD, under `.github/workflows`)
64
+
- Dependabot (for dependency updates, under `.github/dependabot.yml`)
65
+
- Docker
66
+
67
+
**IDE/Editor Support**
68
+
- IntelliJ IDEA
69
+
- Eclipse
70
+
- GitHub Codespaces
71
+
72
+
## Repository Structure
73
+
74
+
A **multi-module** Gradle project composed of 5 modules :
75
+
```txt
76
+
TJ-Bot
77
+
├── application (Application module)
78
+
├── buildSrc (Custom Gradle plugin)
79
+
├── database
80
+
├── formatter
81
+
├── utils
82
+
```
83
+
84
+
The repository has other directories that are not modules :
85
+
86
+
-`.devcontainer` and `.vscode` directories are only about giving support to coding on [GitHub's Codespaces](https://github.com/features/codespaces).
87
+
The project is not intended necessarily to be run in a container or a specific IDE_.
88
+
-`.github` directory contains configuration files for GitHub Actions, Dependabot, and other GitHub features.
89
+
-`.gradle` directory contains the Gradle wrapper files, allowing the project to be built with a specific version of Gradle without requiring users to install it manually, ignore it.
90
+
-`meta` directory currently contains 3 [draw.io](https://www.drawio.com/) diagram files about the project, and a `google-style-eclipse.xml` file used in Spotless configuration.
91
+
-`scripts` directory currently contains only one file which is a git pre-commit hook that runs Spotless to format the code before committing.
92
+
93
+
## Application
94
+
95
+
This is the main module. It contains the entry point, core logic, feature implementations, configuration management, and logging utilities for the bot.
96
+
97
+
Most packages are equipped with a `package-info.java` file, which contains a brief description and 2 annotations
98
+
-`@MethodsReturnNonnullByDefault`: defined in the `/utils` module, indicating that all methods in the package return non-null values by default.
99
+
-`@ParametersAreNonnullByDefault`: from `javax.annotation` package, indicating that all parameters in the package are non-null by default.
100
+
101
+
### 1. `config`:
102
+
103
+
Purpose: Handles all configuration aspects of the bot, including loading, validating, and providing access to configuration values.
104
+
105
+
Contents:
106
+
- Classes for parsing and representing configuration files (e.g., `config.json.template`).
107
+
- Utilities for environment variable overrides and runtime configuration changes.
108
+
- Central access point for configuration values used throughout the application.
109
+
110
+
### 2. `features`
111
+
112
+
Purpose: Implements the bot’s features, including commands, event listeners, and integrations.
113
+
114
+
Contents:
115
+
- Command classes extending `SlashCommandAdapter` for Discord slash commands.
116
+
- Event listeners for handling Discord events (e.g., user asked a question, question answered).
117
+
- Feature registration and lifecycle management (e.g., Features.createFeatures).
118
+
- Sub-packages for organizing features by domain (e.g., basic, chatgpt (openai), code, projects, and others).
119
+
120
+
### 3. `logging`
121
+
122
+
Purpose: Provides logging configuration and utilities for the application.
0 commit comments