New Update - #9
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
There was a problem hiding this comment.
Pull Request Overview
This PR implements a comprehensive rebranding from "Ketsuna" to "Morgane AI" along with significant feature additions including Discord bot sharding capabilities, blacklist functionality, and new slash commands. The changes modernize the codebase and add robust user management features.
- Rebrands the entire application from "Ketsuna" to "Morgane AI" with updated URLs and references
- Implements Discord bot sharding system with management commands and monitoring capabilities
- Adds comprehensive blacklist functionality to restrict user access to commands
- Introduces multiple new slash commands for bot interaction and information display
Reviewed Changes
Copilot reviewed 27 out of 30 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| whitelist.json | New whitelist configuration file with initial user ID |
| src/utils/blacklist.ts | Blacklist utility functions for user access control |
| src/shard.ts | Complete sharding system implementation with management commands |
| src/main.ts | Updated main entry point with shard support and removed website integration |
| src/bot/list.commands.ts | Exports for new command modules |
| src/bot/index.ts | Core bot rebranding and updated configuration |
| src/bot/commands/* | Multiple new slash commands with blacklist integration |
| src/blacklist.ts | Alternative blacklist implementation |
| package.json | Added node-fetch dependency |
| blacklist.json | Blacklist configuration with user IDs |
| README.md | Complete documentation rewrite for Morgane AI |
| .swcrc | Simplified build configuration |
Comments suppressed due to low confidence (1)
src/bot/commands/vote.ts:17
- The class name "GayCommand" does not match the command functionality which is for voting. It should be renamed to "VoteCommand" to reflect its actual purpose.
export class GayCommand extends CommandsBase {
| // Fonction pour charger la liste noire à partir du fichier JSON | ||
| export function loadBlacklist(): string[] { | ||
| try { | ||
| const data = fs.readFileSync("../blacklist.json", "utf8"); |
There was a problem hiding this comment.
The relative path "../blacklist.json" is unreliable and may not work correctly when the code is executed from different directories. Use path.resolve() with __dirname to create an absolute path.
| const data = fs.readFileSync("../blacklist.json", "utf8"); | |
| const data = fs.readFileSync(path.resolve(__dirname, "../blacklist.json"), "utf8"); |
| // Fonction pour sauvegarder la liste noire dans le fichier JSON | ||
| export function saveBlacklist(blacklist: string[]): void { | ||
| const jsonData = JSON.stringify({ blacklist }, null, 2); | ||
| fs.writeFileSync("../blacklist.json", jsonData, "utf8"); |
There was a problem hiding this comment.
The relative path "../blacklist.json" is unreliable and may not work correctly when the code is executed from different directories. Use path.resolve() with __dirname to create an absolute path.
| const json = JSON.parse(data); | ||
| return json.blacklist || []; | ||
| } catch (err) { | ||
| console.error("Erreur de chargement de la blacklist : ", err); |
There was a problem hiding this comment.
[nitpick] The error message is in French. For consistency with the codebase which appears to be primarily in English, consider using "Error loading blacklist:" instead of "Erreur de chargement de la blacklist :".
| console.error("Erreur de chargement de la blacklist : ", err); | |
| console.error("Error loading blacklist:", err); |
|
|
||
| dotenv.config(); | ||
|
|
||
| // Vérification des variables d'environnement |
There was a problem hiding this comment.
[nitpick] Comment is in French. For consistency with the codebase, consider using English: "// Environment variables verification".
| // Vérification des variables d'environnement | |
| // Environment variables verification |
| phrase: "https://top.gg/fr/bot/1190014646351036577", | ||
| locale: interaction.locale, | ||
| }, randomPercentage.toString()), |
There was a problem hiding this comment.
The vote command generates a random percentage but doesn't use it meaningfully. The variable is passed to a localization function that expects a URL, not a percentage, making this functionality broken.
| phrase: "https://top.gg/fr/bot/1190014646351036577", | |
| locale: interaction.locale, | |
| }, randomPercentage.toString()), | |
| phrase: `You voted with a confidence level of ${randomPercentage}%!`, | |
| locale: interaction.locale, | |
| }), |
|
|
||
| if (GUILD_COUNT === 0) { | ||
| console.log("[ShardManager] The bot is not in any guilds. Exiting..."); | ||
| process.exit(1); // Si le bot n'est dans aucune guilde, sortir |
There was a problem hiding this comment.
[nitpick] Comment is in French. For consistency, use English: "// If the bot is not in any guilds, exit".
| process.exit(1); // Si le bot n'est dans aucune guilde, sortir | |
| process.exit(1); // If the bot is not in any guilds, exit |
| import dotenv from "dotenv"; | ||
| import Bot from "./bot"; | ||
| import Website from "./website"; | ||
| import Bot from "./bot"; // Assure-toi que la classe Bot est bien définie pour gérer ton bot |
There was a problem hiding this comment.
[nitpick] Comment is in French. For consistency, use English: "// Make sure the Bot class is properly defined to handle your bot".
| import Bot from "./bot"; // Assure-toi que la classe Bot est bien définie pour gérer ton bot | |
| import Bot from "./bot"; // Make sure the Bot class is properly defined to handle your bot |
| return { | ||
| attachment: generation.img, | ||
| name: 'image' + i + '.webp' | ||
| name: 'image' + i + '.png' |
There was a problem hiding this comment.
[nitpick] Use template literals for better readability: image${i}.png instead of string concatenation.
| name: 'image' + i + '.png' | |
| name: `image${i}.png` |
| const json = JSON.parse(data); | ||
| return json.blacklist || []; | ||
| } catch (err) { | ||
| console.error("Erreur de chargement de la blacklist : ", err); |
There was a problem hiding this comment.
[nitpick] Error message is in French. For consistency, use English: "Error loading blacklist:".
| console.error("Erreur de chargement de la blacklist : ", err); | |
| console.error("Error loading blacklist:", err); |
- Ajout .env.exemple - Modification de .swcrc en swcrc.example - Modification / amélioration du Readme.md
No description provided.