Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📝 Edit badges #81

Merged
merged 7 commits into from
Jan 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/2-bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: "\U0001F41E Reporter un bug"
about: Une erreur dans le code ? Un crash ?
---

#🐞 Reporter un bug
# 🐞 Reporter un bug

### Description

Expliquez le problème très clairement et ce que ça produit.

###🔥 Exception ou Erreur
### 🔥 Exception ou Erreur

<pre><code>

Expand All @@ -18,7 +18,7 @@ Expliquez le problème très clairement et ce que ça produit.

</code></pre>

###🌍 Votre environnement
### 🌍 Votre environnement

**Version NodeJS** :
**Version NPM** :
Expand Down
6 changes: 4 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
## Liste de contrôle des relations publiques
Veuillez vérifier si votre PR remplit les conditions suivantes :
<!-- Veuillez vérifier si votre PR remplit les conditions suivantes :

- Le message d'engagement suit [nos directives](https://github.com/thomasbnt/Bord-Pi#contributions).
- Des tests pour les modifications ont été effectués (pour les corrections de bug/fonctions).
- Les documents ont été ajoutés/mis à jour (pour les corrections/fonctionnalités de bug).

-->

## Description

## Type PR
Quel genre de changement ce PR apporte-t-il ?
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

[![Discord](https://img.shields.io/discord/367753345575944221?color=%237289DA&label=Nous%20rejoindre&logo=Discord&logoColor=white)](https://thomasbnt.dev/discord)
[![Voir les Releases](https://img.shields.io/github/v/release/thomasbnt/Bord-Pi?color=6897BB&include_prereleases)](https://github.com/thomasbnt/Bord-Pi/releases)
![GitHub last commit](https://img.shields.io/github/last-commit/thomasbnt/bord-Pi)
[![Depfu](https://badges.depfu.com/badges/4f3ee9b9ab1cf47c382471fa830483d9/count.svg)](https://depfu.com/github/thomasbnt/Bord-Pi?project_id=37111)
[![Discord](https://img.shields.io/discord/367753345575944221?color=%237289DA&label=Nous%20rejoindre&logo=Discord&logoColor=white?&style=for-the-badge)](https://thomasbnt.dev/discord)
[![Voir les Releases](https://img.shields.io/github/v/release/thomasbnt/Bord-Pi?color=6897BB&include_prereleases?&style=for-the-badge)](https://github.com/thomasbnt/Bord-Pi/releases)
![GitHub last commit](https://img.shields.io/github/last-commit/thomasbnt/bord-Pi?&style=for-the-badge)
[![Depfu](https://img.shields.io/depfu/dependencies/github/thomasbnt/Bord-Pi?style=for-the-badge)](https://depfu.com/github/thomasbnt/Bord-Pi?project_id=37111)
____

## Introduction
Expand Down
5 changes: 1 addition & 4 deletions commands/bord.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ module.exports = {
.setColor(config.colors.PrimaryColor)
.setTitle(`${client.user.username} — Panel d'aide`)
.setThumbnail(client.user.avatarURL({ format: 'png', size: 1024 }))
.setFooter({
text: `Un robot Discord gérant et aidant les utilisateurs pour votre propre serveur.`,
iconURL: client.user.avatarURL({ format: 'png', size: 1024 })
})
.setDescription(`**${client.user.username}** est un robot Discord qui a été créé pour aider les serveurs Discord à gérer leurs membres, à avoir des logs, filtrer certains liens et avoir **son propre message de bienvenue**. Vous pouvez trouver le code source du robot sur [GitHub](${config.GitHubProjectURL}).`)

interaction.reply({
embeds: [BordEmbed],
Expand Down
16 changes: 10 additions & 6 deletions events/guildMemberAdd.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const config = require('../config.json')
const BordPiHelper = require('../modules/BordPiHelper')
const { EmbedBuilder } = require('discord.js')
const { EmbedBuilder, escapeMarkdown } = require('discord.js')
module.exports = {
name: 'guildMemberAdd',
description: 'Guild Member Add',
execute(member, client) {
if (config.serverId) {
const g = client.guilds.cache.get(config.serverId)
if (g && g.available) {
const guild = client.guilds.cache.get(config.serverId)
if (guild && guild.available) {
console.log(
`📥 — ${member.user.username} (${member.id}) a rejoint ${g.name}`
`📥 — ${member.user.username} (${member.id}) a rejoint ${guild.name}`
)
const ChannelGeneral = g.channels.cache.find(
const ChannelGeneral = guild.channels.cache.find(
(x) => x.id === config.IDWelcomeChannel
)

Expand All @@ -25,9 +25,13 @@ module.exports = {
size: 1024
})
})
.setFooter({
text: `${member.id}`
})
.setColor(BordPiHelper.getRandomColor())
.setDescription(`> Bienvenue parmi-nous <@${member.id}> (${member.id}), ne sois pas timide, discute librement, présente-toi au peuple, personne ne mord !\n> N'hésites pas à t'attribuer des rôles dans <id:customize> !`)
.setDescription(`> Bienvenue parmi-nous ${escapeMarkdown(member.user.username)}, ne sois pas timide, discute librement, présente-toi au peuple, personne ne mord !\nN'hésites pas à t'attribuer des rôles dans <id:customize> !`)
ChannelGeneral.send({
content: `<@${member.id}> par ici ! `,
embeds: [WelcomeEmbed]
})
.then((msg) => {
Expand Down
4 changes: 2 additions & 2 deletions events/guildMemberRemove.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ module.exports = {
name: 'guildMemberRemove',
description: 'Guild Member Remove',
execute(member, client) {
const g = client.guilds.cache.get(config.serverId)
const guild = client.guilds.cache.get(config.serverId)
BordPiHelper.LogsMemberInOutServer(
member,
`quitté`,
config.colors.DangerColor
)
console.log(`📥 — ${member.username} (${member.id}) a rejoint ${g.name}`)
console.log(`📥 — ${member.username} (${member.id}) a rejoint ${guild.name}`)
}
}
10 changes: 5 additions & 5 deletions modules/BordPiHelper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { EmbedBuilder, WebhookClient } = require('discord.js')
const config = require('../config.json')
const w = new WebhookClient({
const webhook = new WebhookClient({
id: config.WebhookLogs.id,
token: config.WebhookLogs.token
})
Expand All @@ -19,7 +19,7 @@ class BordPiHelper {
url: `https://whois.mrrobot.app/${member.id}`
})
.setDescription(`${action}`)
w.send({ embeds: [LogEmbed] }).catch(console.error)
webhook.send({ embeds: [LogEmbed] }).catch(console.error)
}

// Même chose ici, pour les logs, mais spécialement pour les arrivants et départs de membres.
Expand Down Expand Up @@ -49,13 +49,13 @@ class BordPiHelper {
])
.setThumbnail(member.user.displayAvatarURL())
.setTimestamp(new Date())
w.send({ embeds: [LogsJoinEmbed] }).catch(console.error)
webhook.send({ embeds: [LogsJoinEmbed] }).catch(console.error)
}

// Cela récupère value et la convertit en timestamp.
IsoStringToTimeStamp(value) {
const d = new Date(value)
return Math.floor(d / 1000)
const date = new Date(value)
return Math.floor(date / 1000)
}

// Une couleur aléatoire pour vos embeds ? C'est ici.
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bordpi",
"version": "3.0.0",
"version": "3.1.0",
"description": "Un robot Discord gérant et aidant les utilisateurs pour son propre serveur. ",
"main": "app.js",
"scripts": {
Expand All @@ -11,7 +11,11 @@
"bot",
"discordjs"
],
"author": "Thomas Bnt <[email protected]>",
"author": {
"name": "Thomas Bnt",
"email": "[email protected]",
"url": "https://thomasbnt.dev"
},
"license": "GPL-3.0-only",
"dependencies": {
"@discordjs/rest": "^1.5.0",
Expand Down