Skip to content

Commit

Permalink
ft: use env variable for channel
Browse files Browse the repository at this point in the history
  • Loading branch information
rick-gnous committed Nov 14, 2024
1 parent 4a71365 commit 4e446b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ GUILD_ID="" # id du serveur (clic droit sur l'icone du serveur > copier l'identi
MONEY="Points CDS"
DEVELOPERS="229312422043713537,283681024360054785,163697401935298560" # Dans l'ordre : Tobi, Kekwel, Rick
MAX_GRPS=5
ERROR_CHANNEL="" # l'id du salon où le bot va envoyer un message contenant la stacktrace de l'erreur ainsi qu'un fichier avec les logs
6 changes: 3 additions & 3 deletions util/envoiMsg.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ module.exports.createLogs = async (
* @param title
*/
module.exports.sendStackTrace = (client, error, title) => {
const ERROR_CHANNEL_ID = "921354124262535198"; // Id du salon d'erreur du CDS Discodeur

// Définir un chemin pour le fichier d'erreur
const filePath = path.join(__dirname, "error-log.txt");
fs.writeFileSync(
Expand All @@ -163,7 +161,9 @@ module.exports.sendStackTrace = (client, error, title) => {
})
.setTimestamp();

const errorChannel = client.channels.cache.get(ERROR_CHANNEL_ID);
const errorChannel = client.channels.cache.get(
`${process.env.ERROR_CHANNEL}`,
);
if (errorChannel) {
errorChannel
.send({ embeds: [errorEmbed] }) // envoie l'embed
Expand Down

0 comments on commit 4e446b5

Please sign in to comment.