This repository was archived by the owner on Aug 21, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 9 files changed +24
-9
lines changed
java/fr/funixgaming/funixbot/discord Expand file tree Collapse file tree 9 files changed +24
-9
lines changed Original file line number Diff line number Diff line change 55 <parent >
66 <artifactId >funix-bot</artifactId >
77 <groupId >fr.funixgaming.funixbot</groupId >
8- <version >1.1.5 </version >
8+ <version >1.1.6 </version >
99 </parent >
1010
1111 <modelVersion >4.0.0</modelVersion >
1212
1313 <groupId >fr.funixgaming.funixbot.core</groupId >
1414 <artifactId >core</artifactId >
15- <version >1.1.5 </version >
15+ <version >1.1.6 </version >
1616
1717 <build >
1818 <plugins >
Original file line number Diff line number Diff line change 66 <parent >
77 <artifactId >funix-bot</artifactId >
88 <groupId >fr.funixgaming.funixbot</groupId >
9- <version >1.1.5 </version >
9+ <version >1.1.6 </version >
1010 </parent >
1111
1212 <modelVersion >4.0.0</modelVersion >
1313
1414 <groupId >fr.funixgaming.funixbot.discord</groupId >
1515 <artifactId >funix-bot-discord</artifactId >
16- <version >1.1.5 </version >
16+ <version >1.1.6 </version >
1717
1818 <dependencies >
1919 <dependency >
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ public class BotConfig {
1919 private String generalChannelId ;
2020 private String rolesChannelId ;
2121
22+ private String followerRoleId ;
2223 private String twitchNotifRoleId ;
2324 private String youtubeNotifRoleId ;
2425 private String tiktokNotifRoleId ;
Original file line number Diff line number Diff line change 77import lombok .AllArgsConstructor ;
88import lombok .extern .slf4j .Slf4j ;
99import net .dv8tion .jda .api .EmbedBuilder ;
10+ import net .dv8tion .jda .api .entities .Guild ;
1011import net .dv8tion .jda .api .entities .User ;
1112import net .dv8tion .jda .api .events .guild .GuildBanEvent ;
1213import net .dv8tion .jda .api .events .guild .GuildUnbanEvent ;
@@ -44,6 +45,15 @@ public void onGuildMemberRemove(@NotNull GuildMemberRemoveEvent event) {
4445 @ Override
4546 public void onGuildMemberJoin (@ NotNull GuildMemberJoinEvent event ) {
4647 guildMemberEventLog (event .getUser (), GuildEventType .JOIN );
48+
49+ try {
50+ final FunixBot funixBot = FunixBot .getInstance ();
51+ final Guild guild = funixBot .getBotGuild ();
52+
53+ guild .addRoleToMember (event .getUser (), funixBot .getBotRoles ().getFollowerRole ()).queue ();
54+ } catch (FunixBotException e ) {
55+ log .error ("Erreur pendant l'ajout d'un membre au discord {}." , e .getMessage ());
56+ }
4757 }
4858
4959 private void guildMemberEventLog (final User user , final GuildEventType eventType ) {
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ public class BotRoles {
1313 private final Role twitchNotifRole ;
1414 private final Role youtubeNotifRole ;
1515 private final Role tiktokNotifRole ;
16+ private final Role followerRole ;
1617
1718 public BotRoles (final FunixBot funixBot ) throws FunixBotException {
1819 final Guild guild = funixBot .getBotGuild ();
@@ -21,8 +22,9 @@ public BotRoles(final FunixBot funixBot) throws FunixBotException {
2122 this .twitchNotifRole = guild .getRoleById (botConfig .getTwitchNotifRoleId ());
2223 this .youtubeNotifRole = guild .getRoleById (botConfig .getYoutubeNotifRoleId ());
2324 this .tiktokNotifRole = guild .getRoleById (botConfig .getTiktokNotifRoleId ());
25+ this .followerRole = guild .getRoleById (botConfig .getFollowerRoleId ());
2426
25- if (this .twitchNotifRole == null || this .youtubeNotifRole == null || this .tiktokNotifRole == null ) {
27+ if (this .twitchNotifRole == null || this .youtubeNotifRole == null || this .tiktokNotifRole == null || this . followerRole == null ) {
2628 throw new FunixBotException ("L'un des rôles n'existe pas sur le discord." );
2729 }
2830 }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ discord.bot.config.log-channel-id=687278453640527883
1111discord.bot.config.general-channel-id =687238121712254990
1212discord.bot.config.roles-channel-id =984116014335803422
1313
14+ discord.bot.config.follower-role-id =687290866121179136
1415discord.bot.config.twitch-notif-role-id =984969123924697158
1516discord.bot.config.youtube-notif-role-id =986293102048342097
1617discord.bot.config.tiktok-notif-role-id =986293280851497051
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ discord.bot.config.log-channel-id=${DISCORD_LOG_CHANNEL_ID}
2525discord.bot.config.general-channel-id =${DISCORD_GENERAL_CHANNEL_ID}
2626discord.bot.config.roles-channel-id =${DISCORD_ROLES_CHANNEL_ID}
2727
28+ discord.bot.config.follower-role-id =${DISCORD_FOLLOWER_ROLE_ID}
2829discord.bot.config.twitch-notif-role-id =${DISCORD_TWITCH_NOTIF_ROLE_ID}
2930discord.bot.config.youtube-notif-role-id =${DISCORD_YOUTUBE_NOTIF_ROLE_ID}
3031discord.bot.config.tiktok-notif-role-id =${DISCORD_TIKTOK_NOTIF_ROLE_ID}
Original file line number Diff line number Diff line change 66 <parent >
77 <artifactId >funix-bot</artifactId >
88 <groupId >fr.funixgaming.funixbot</groupId >
9- <version >1.1.5 </version >
9+ <version >1.1.6 </version >
1010 </parent >
1111
1212 <modelVersion >4.0.0</modelVersion >
1313
1414 <groupId >fr.funixgaming.funixbot.twitch</groupId >
1515 <artifactId >funix-bot-twitch</artifactId >
16- <version >1.1.5 </version >
16+ <version >1.1.6 </version >
1717
1818 <dependencies >
1919 <dependency >
Original file line number Diff line number Diff line change 88 <artifactId >funix-bot</artifactId >
99 <name >FunixBot</name >
1010 <packaging >pom</packaging >
11- <version >1.1.5 </version >
11+ <version >1.1.6 </version >
1212
1313 <parent >
1414 <artifactId >funix-api</artifactId >
6262 <java .version>17</java .version>
6363
6464 <twitchApi .version>1.2.2</twitchApi .version>
65- <funixbot .core.version>1.1.5 </funixbot .core.version>
65+ <funixbot .core.version>1.1.6 </funixbot .core.version>
6666
6767 <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
6868 <commons .io.version>2.11.0</commons .io.version>
You can’t perform that action at this time.
0 commit comments