-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
EazyFTW
committed
Oct 3, 2020
1 parent
de66574
commit 80d3c2d
Showing
2 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
src/main/java/me/TechsCode/TechDiscordBot/module/modules/EventsModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package me.TechsCode.TechDiscordBot.module.modules; | ||
|
||
import me.TechsCode.TechDiscordBot.TechDiscordBot; | ||
import me.TechsCode.TechDiscordBot.logs.ServerLogs; | ||
import me.TechsCode.TechDiscordBot.module.Module; | ||
import me.TechsCode.TechDiscordBot.objects.Requirement; | ||
import me.TechsCode.TechDiscordBot.util.TechEmbedBuilder; | ||
import net.dv8tion.jda.api.events.guild.GuildBanEvent; | ||
import net.dv8tion.jda.api.events.guild.member.GuildMemberJoinEvent; | ||
import net.dv8tion.jda.api.events.guild.member.GuildMemberRemoveEvent; | ||
import net.dv8tion.jda.api.hooks.SubscribeEvent; | ||
|
||
public class EventsModule extends Module { | ||
|
||
public EventsModule(TechDiscordBot bot) { | ||
super(bot); | ||
} | ||
|
||
@Override | ||
public void onEnable() { | ||
|
||
} | ||
|
||
@SubscribeEvent | ||
public void memberJoin(GuildMemberJoinEvent e) { | ||
ServerLogs.log( | ||
new TechEmbedBuilder("Member Joined!") | ||
.success() | ||
.setText("Welcome " + e.getMember().getAsMention() + "(" + e.getUser().getName() + "#" + e.getUser().getDiscriminator() + ", " + e.getUser().getId() + ")") | ||
.setThumbnail(e.getMember().getUser().getAvatarUrl()) | ||
); | ||
} | ||
|
||
@SubscribeEvent | ||
public void memberLeave(GuildMemberRemoveEvent e) { | ||
ServerLogs.log( | ||
new TechEmbedBuilder("Member Left!") | ||
.error() | ||
.setText(e.getUser().getAsMention() + "(" + e.getUser().getName() + "#" + e.getUser().getDiscriminator() + ", " + e.getUser().getId() + ")") | ||
.setThumbnail(e.getUser().getAvatarUrl()) | ||
); | ||
} | ||
|
||
@SubscribeEvent | ||
public void memberBan(GuildBanEvent e) { | ||
ServerLogs.log( | ||
new TechEmbedBuilder("Member Banned!") | ||
.error() | ||
.setText("Don't say goodbye to " + e.getUser().getAsMention() + "(" + e.getUser().getName() + "#" + e.getUser().getDiscriminator() + ", " + e.getUser().getId() + ")") | ||
.setThumbnail(e.getUser().getAvatarUrl()) | ||
); | ||
} | ||
|
||
@Override | ||
public void onDisable() {} | ||
|
||
@Override | ||
public String getName() { | ||
return "Events"; | ||
} | ||
|
||
@Override | ||
public Requirement[] getRequirements() { | ||
return new Requirement[0]; | ||
} | ||
} |