-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #250 from beanbeanjuice/integration
Ready for Release v2.4.3
- Loading branch information
Showing
23 changed files
with
413 additions
and
81 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
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
69 changes: 69 additions & 0 deletions
69
src/main/java/com/beanbeanjuice/command/fun/MemberCountCommand.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,69 @@ | ||
package com.beanbeanjuice.command.fun; | ||
|
||
import com.beanbeanjuice.main.CafeBot; | ||
import com.beanbeanjuice.utility.command.CommandContext; | ||
import com.beanbeanjuice.utility.command.ICommand; | ||
import com.beanbeanjuice.utility.command.usage.Usage; | ||
import com.beanbeanjuice.utility.command.usage.categories.CategoryType; | ||
import net.dv8tion.jda.api.entities.Member; | ||
import net.dv8tion.jda.api.entities.User; | ||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* An {@link ICommand} used to check the {@link net.dv8tion.jda.api.entities.Guild Guild} member count. | ||
* | ||
* @author beanbeanjuice | ||
*/ | ||
public class MemberCountCommand implements ICommand { | ||
|
||
@Override | ||
public void handle(CommandContext ctx, ArrayList<String> args, User user, GuildMessageReceivedEvent event) { | ||
int count = 0; | ||
|
||
for (Member member : event.getGuild().getMembers()) { | ||
if (!member.getUser().isBot()) { | ||
count++; | ||
} | ||
} | ||
|
||
event.getChannel().sendMessage(CafeBot.getGeneralHelper().successEmbed( | ||
"Member Count", | ||
"You currently have `" + count + "` members in your server!" | ||
)).queue(); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "member-count"; | ||
} | ||
|
||
@Override | ||
public ArrayList<String> getAliases() { | ||
ArrayList<String> arrayList = new ArrayList<>(); | ||
arrayList.add("membercount"); | ||
arrayList.add("members"); | ||
return arrayList; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Check the member count for your server!"; | ||
} | ||
|
||
@Override | ||
public String exampleUsage() { | ||
return "`!!members`"; | ||
} | ||
|
||
@Override | ||
public Usage getUsage() { | ||
return new Usage(); | ||
} | ||
|
||
@Override | ||
public CategoryType getCategoryType() { | ||
return CategoryType.GENERIC; | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
src/main/java/com/beanbeanjuice/command/fun/RemoveBirthdayCommand.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,64 @@ | ||
package com.beanbeanjuice.command.fun; | ||
|
||
import com.beanbeanjuice.main.CafeBot; | ||
import com.beanbeanjuice.utility.command.CommandContext; | ||
import com.beanbeanjuice.utility.command.ICommand; | ||
import com.beanbeanjuice.utility.command.usage.Usage; | ||
import com.beanbeanjuice.utility.command.usage.categories.CategoryType; | ||
import net.dv8tion.jda.api.entities.User; | ||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* An {@link ICommand} used to remove your birthday. | ||
* | ||
* @author beanbeanjuice | ||
*/ | ||
public class RemoveBirthdayCommand implements ICommand { | ||
|
||
@Override | ||
public void handle(CommandContext ctx, ArrayList<String> args, User user, GuildMessageReceivedEvent event) { | ||
if (CafeBot.getBirthdayHandler().removeBirthday(user.getId())) { | ||
event.getChannel().sendMessage(CafeBot.getGeneralHelper().successEmbed( | ||
"Removed Birthday", | ||
"Successfully removed your birthday!" | ||
)).queue(); | ||
return; | ||
} | ||
|
||
event.getChannel().sendMessage(CafeBot.getGeneralHelper().sqlServerError()).queue(); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "remove-birthday"; | ||
} | ||
|
||
@Override | ||
public ArrayList<String> getAliases() { | ||
ArrayList<String> arrayList = new ArrayList<>(); | ||
arrayList.add("removebirthday"); | ||
return arrayList; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Remove your birthday."; | ||
} | ||
|
||
@Override | ||
public String exampleUsage() { | ||
return "`!!remove-birthday"; | ||
} | ||
|
||
@Override | ||
public Usage getUsage() { | ||
return new Usage(); | ||
} | ||
|
||
@Override | ||
public CategoryType getCategoryType() { | ||
return CategoryType.FUN; | ||
} | ||
} |
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
67 changes: 67 additions & 0 deletions
67
src/main/java/com/beanbeanjuice/command/fun/TeaMemeCommand.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,67 @@ | ||
package com.beanbeanjuice.command.fun; | ||
|
||
import com.beanbeanjuice.main.CafeBot; | ||
import com.beanbeanjuice.utility.command.CommandContext; | ||
import com.beanbeanjuice.utility.command.ICommand; | ||
import com.beanbeanjuice.utility.command.usage.Usage; | ||
import com.beanbeanjuice.utility.command.usage.categories.CategoryType; | ||
import com.beanbeanjuice.utility.helper.RedditAPI; | ||
import net.dv8tion.jda.api.entities.User; | ||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* An {@link ICommand} to send Tea memes. | ||
* | ||
* @author beanbeanjuice | ||
*/ | ||
public class TeaMemeCommand implements ICommand { | ||
|
||
@Override | ||
public void handle(CommandContext ctx, ArrayList<String> args, User user, GuildMessageReceivedEvent event) { | ||
event.getChannel().sendMessage(new RedditAPI().getRedditEmbed(getSubreddits().get(CafeBot.getGeneralHelper().getRandomNumber(0, getSubreddits().size())))).queue(); | ||
} | ||
|
||
@NotNull | ||
private ArrayList<String> getSubreddits() { | ||
ArrayList<String> arrayList = new ArrayList<>(); | ||
arrayList.add("TeaPorn"); | ||
arrayList.add("TeaPictures"); | ||
return arrayList; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "tea-meme"; | ||
} | ||
|
||
@Override | ||
public ArrayList<String> getAliases() { | ||
ArrayList<String> arrayList = new ArrayList<>(); | ||
arrayList.add("teameme"); | ||
arrayList.add("tea"); | ||
return arrayList; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Get a tea meme!"; | ||
} | ||
|
||
@Override | ||
public String exampleUsage() { | ||
return "`!!tea`"; | ||
} | ||
|
||
@Override | ||
public Usage getUsage() { | ||
return new Usage(); | ||
} | ||
|
||
@Override | ||
public CategoryType getCategoryType() { | ||
return CategoryType.FUN; | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
src/main/java/com/beanbeanjuice/command/generic/BotInviteCommand.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,61 @@ | ||
package com.beanbeanjuice.command.generic; | ||
|
||
import com.beanbeanjuice.main.CafeBot; | ||
import com.beanbeanjuice.utility.command.CommandContext; | ||
import com.beanbeanjuice.utility.command.ICommand; | ||
import com.beanbeanjuice.utility.command.usage.Usage; | ||
import com.beanbeanjuice.utility.command.usage.categories.CategoryType; | ||
import net.dv8tion.jda.api.entities.User; | ||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* An {@link ICommand} used to get an invite link for the bot. | ||
* | ||
* @author beanbeanjuice | ||
*/ | ||
public class BotInviteCommand implements ICommand { | ||
|
||
@Override | ||
public void handle(CommandContext ctx, ArrayList<String> args, User user, GuildMessageReceivedEvent event) { | ||
event.getChannel().sendMessage(CafeBot.getGeneralHelper().successEmbed( | ||
"Bot Invite Link", | ||
"Click [this](https://discord.com/api/oauth2/authorize?client_id=787162619504492554&permissions=305917254&scope=bot) to invite the bot to your server!" | ||
)).queue(); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "invite-bot"; | ||
} | ||
|
||
@Override | ||
public ArrayList<String> getAliases() { | ||
ArrayList<String> arrayList = new ArrayList<>(); | ||
arrayList.add("invitebot"); | ||
arrayList.add("bot-invite"); | ||
arrayList.add("botinvite"); | ||
return arrayList; | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Get an invite for the bot to add it to your server!"; | ||
} | ||
|
||
@Override | ||
public String exampleUsage() { | ||
return "`!!botinvite`"; | ||
} | ||
|
||
@Override | ||
public Usage getUsage() { | ||
return new Usage(); | ||
} | ||
|
||
@Override | ||
public CategoryType getCategoryType() { | ||
return CategoryType.GENERIC; | ||
} | ||
} |
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
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
Oops, something went wrong.