Skip to content

Commit

Permalink
Added the credits command.
Browse files Browse the repository at this point in the history
  • Loading branch information
RedstoneTek committed Jun 28, 2019
1 parent 09e5ae8 commit 041bb9c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.tek</groupId>
<artifactId>guardian</artifactId>
<version>1.2</version>
<version>1.3</version>
<packaging>jar</packaging>

<name>guardian</name>
Expand Down
39 changes: 39 additions & 0 deletions src/main/java/com/tek/guardian/commands/CreditsCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.tek.guardian.commands;

import java.awt.Color;
import java.util.Arrays;

import com.tek.guardian.data.ServerProfile;
import com.tek.guardian.main.Reference;

import net.dv8tion.jda.api.JDA;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Member;
import net.dv8tion.jda.api.entities.MessageEmbed;
import net.dv8tion.jda.api.entities.TextChannel;

public class CreditsCommand extends Command {

public CreditsCommand() {
super("credits", Arrays.asList("info", "desc", "description"), null, "Displays the bot credits and information.", true);
}

@Override
public boolean call(JDA jda, ServerProfile profile, Member member, Guild guild, TextChannel channel, String label, String[] args) {
if(args.length == 0) {
MessageEmbed embed = Reference.formatEmbed(jda, "Credits")
.setColor(Color.green)
.setDescription("Some credits and information about the bot.")
.addField("Huge thanks to", "[Austin Keener](https://github.com/DV8FromTheWorld) - Developer of JDA\n[John Grosh](https://github.com/jagrosh) - Developer of JDA Utilities\nDiscord - Hosting this cool event /o/\nFriends - Epic ideas and support", true)
.addField("Discord Library", "[JDA](https://github.com/DV8FromTheWorld/JDA) - Java", true)
.addField("Developer", "RedstoneTek / Toon Link#8313", true)
.addField("Additional Information", "This bot was made in 5 days within the **Discord Hack Week**.", true)
.build();
channel.sendMessage(embed).queue();
return true;
} else {
return false;
}
}

}
2 changes: 2 additions & 0 deletions src/main/java/com/tek/guardian/main/Guardian.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.tek.guardian.commands.ClearCommand;
import com.tek.guardian.commands.CommandHandler;
import com.tek.guardian.commands.ConfigCommand;
import com.tek.guardian.commands.CreditsCommand;
import com.tek.guardian.commands.CustomVoiceChannelCommand;
import com.tek.guardian.commands.DeafenCommand;
import com.tek.guardian.commands.GuideCommand;
Expand Down Expand Up @@ -116,6 +117,7 @@ public void start() throws LoginException, InterruptedException {
commandHandler.registerCommand(new TempdeafenCommand());
commandHandler.registerCommand(new UndeafenCommand());
commandHandler.registerCommand(new PingCommand());
commandHandler.registerCommand(new CreditsCommand());

jda.addEventListener(waiter, commandHandler, new ServerStatusListener(),
new VoiceChannelListener(), new AccountFlaggingListener(), new ReactionRoleListener(),
Expand Down

0 comments on commit 041bb9c

Please sign in to comment.