-
-
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 #181 from beanbeanjuice/integration
Ready for Release v2.2.1
- Loading branch information
Showing
11 changed files
with
249 additions
and
14 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
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
94 changes: 94 additions & 0 deletions
94
src/main/java/com/beanbeanjuice/command/interaction/BonkCommand.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,94 @@ | ||
package com.beanbeanjuice.command.interaction; | ||
|
||
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.command.usage.types.CommandType; | ||
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 bonk people. | ||
* | ||
* @author beanbeanjuice | ||
*/ | ||
public class BonkCommand implements ICommand { | ||
|
||
@Override | ||
public void handle(CommandContext ctx, ArrayList<String> args, User user, GuildMessageReceivedEvent event) { | ||
String url = CafeBot.getInteractionHandler().getBonkImage(); | ||
String sender = user.getName(); | ||
|
||
ArrayList<User> receivers = new ArrayList<>(); | ||
int count = 0; | ||
|
||
if (!args.isEmpty()) { | ||
while (CafeBot.getGeneralHelper().getUser(args.get(count)) != null) { | ||
receivers.add(CafeBot.getGeneralHelper().getUser(args.get(count++))); | ||
if (count == args.size()) { | ||
break; | ||
} | ||
} | ||
} | ||
|
||
StringBuilder stringBuilder = new StringBuilder(); | ||
for (int i = count; i < args.size(); i++) { | ||
stringBuilder.append(args.get(i)); | ||
if (i != args.size() - 1) { | ||
stringBuilder.append(" "); | ||
} | ||
} | ||
|
||
String message; | ||
|
||
if (receivers.size() == 0) { | ||
message = "**" + sender + "** *bonked* themselves! They sent themselves to ***__H O R N Y__*** jail. At least they're self aware."; | ||
} else { | ||
message = "**" + sender + "** *bonked* **" + CafeBot.getInteractionHandler().getReceiverString(receivers) + "**!"; | ||
} | ||
|
||
if (stringBuilder.isEmpty()) { | ||
event.getChannel().sendMessage(message).embed(CafeBot.getInteractionHandler().actionEmbed(url)).queue(); | ||
} else { | ||
event.getChannel().sendMessage(message).embed(CafeBot.getInteractionHandler().actionWithDescriptionEmbed(url, stringBuilder.toString())).queue(); | ||
} | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "bonk"; | ||
} | ||
|
||
@Override | ||
public ArrayList<String> getAliases() { | ||
return new ArrayList<>(); | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Bonk someone!"; | ||
} | ||
|
||
@Override | ||
public String exampleUsage() { | ||
return "`!!bonk @beanbeanjuice` or `!!bonk @beanbeanjuice :O`"; | ||
} | ||
|
||
@Override | ||
public Usage getUsage() { | ||
Usage usage = new Usage(); | ||
usage.addUsage(CommandType.SENTENCE, "Users + Extra Message", false); | ||
return usage; | ||
} | ||
|
||
@Override | ||
public CategoryType getCategoryType() { | ||
return CategoryType.INTERACTION; | ||
} | ||
|
||
|
||
} |
93 changes: 93 additions & 0 deletions
93
src/main/java/com/beanbeanjuice/command/interaction/DabCommand.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,93 @@ | ||
package com.beanbeanjuice.command.interaction; | ||
|
||
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.command.usage.types.CommandType; | ||
import net.dv8tion.jda.api.entities.User; | ||
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent; | ||
|
||
import java.util.ArrayList; | ||
|
||
/** | ||
* An {@link ICommand} used for dabbing at people. | ||
* | ||
* @author beanbeanjuice | ||
*/ | ||
public class DabCommand implements ICommand { | ||
|
||
@Override | ||
public void handle(CommandContext ctx, ArrayList<String> args, User user, GuildMessageReceivedEvent event) { | ||
String url = CafeBot.getInteractionHandler().getDabImage(); | ||
String sender = user.getName(); | ||
|
||
ArrayList<User> receivers = new ArrayList<>(); | ||
int count = 0; | ||
|
||
if (!args.isEmpty()) { | ||
while (CafeBot.getGeneralHelper().getUser(args.get(count)) != null) { | ||
receivers.add(CafeBot.getGeneralHelper().getUser(args.get(count++))); | ||
if (count == args.size()) { | ||
break; | ||
} | ||
} | ||
} | ||
|
||
StringBuilder stringBuilder = new StringBuilder(); | ||
for (int i = count; i < args.size(); i++) { | ||
stringBuilder.append(args.get(i)); | ||
if (i != args.size() - 1) { | ||
stringBuilder.append(" "); | ||
} | ||
} | ||
|
||
String message; | ||
|
||
if (receivers.size() == 0) { | ||
message = "**" + sender + "** *dabbed*! That's... so cringey..."; | ||
} else { | ||
message = "**" + sender + "** *dabbed* at **" + CafeBot.getInteractionHandler().getReceiverString(receivers) + "**."; | ||
} | ||
|
||
if (stringBuilder.isEmpty()) { | ||
event.getChannel().sendMessage(message).embed(CafeBot.getInteractionHandler().actionEmbed(url)).queue(); | ||
} else { | ||
event.getChannel().sendMessage(message).embed(CafeBot.getInteractionHandler().actionWithDescriptionEmbed(url, stringBuilder.toString())).queue(); | ||
} | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "dab"; | ||
} | ||
|
||
@Override | ||
public ArrayList<String> getAliases() { | ||
return new ArrayList<>(); | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return "Dab at someone!"; | ||
} | ||
|
||
@Override | ||
public String exampleUsage() { | ||
return "`!!dab @beanbeanjuice` or `!!dab @beanbeanjuice :O`"; | ||
} | ||
|
||
@Override | ||
public Usage getUsage() { | ||
Usage usage = new Usage(); | ||
usage.addUsage(CommandType.SENTENCE, "Users + Extra Message", false); | ||
return usage; | ||
} | ||
|
||
@Override | ||
public CategoryType getCategoryType() { | ||
return CategoryType.INTERACTION; | ||
} | ||
|
||
} |
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
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
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