Skip to content

Commit

Permalink
Merge pull request #565 from beanbeanjuice/integration
Browse files Browse the repository at this point in the history
Integration v3.1.4
  • Loading branch information
beanbeanjuice committed May 7, 2023
2 parents d77d556 + efbb0e4 commit 74caea9
Show file tree
Hide file tree
Showing 24 changed files with 224 additions and 73 deletions.
24 changes: 17 additions & 7 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,36 @@ assignees: beanbeanjuice

---

**__Describe the Bug__**
## Bug Description
A clear and concise description of what the bug is.

**__Steps To Reproduce__**
Steps to reproduce the behavior:
___

## Steps to Reproduce the Bug
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**__Expected Behavior__**
___

## Expected Behaviour
A clear and concise description of what you expected to happen.

**__Screenshots/Videos__**
___

## Screenshots/Videos
If applicable, add screenshots or videos to help explain your problem. Links are preferred.

**__Additional Context__**
___

## Additional Context

Add any other context about the problem here.

# Checklist:
___

## Checklist

- [ ] I have checked for similar issues.
- [ ] This is a bug report, not a feature request, improvement request, or security vulnerability report.
14 changes: 10 additions & 4 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@ assignees: beanbeanjuice

---

**__Describe the Feature__**
## Feature Description
A clear and concise description of what you want to happen.

**__Describe Alternatives__**
___

## Feature Alternatives
A clear and concise description of any alternative solutions or features you've considered.

**__Additional Context__**
___

## Additional Context
Add any other context or screenshots about the feature request here.

# Checklist:
___

## Checklist

- [ ] I have checked for similar issues.
- [ ] This is a feature request, not an improvement request, bug report, or security vulnerability report.
12 changes: 8 additions & 4 deletions .github/ISSUE_TEMPLATE/improvement-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ assignees: beanbeanjuice

---

**__Describe the Improvement__**
A clear and concise description of what you want to happen.
## Improvement Description
A clear and concise description of what you want to happen. Diagrams and drawings are welcome.

**__Additional Context__**
___

## Additional Context
Add any other context or screenshots about the improvement request here.

# Checklist:
___

## Checklist

- [ ] I have checked for similar issues.
- [ ] This is an improvement request, not a feature request, bug report, or security vulnerability report.
10 changes: 7 additions & 3 deletions .github/ISSUE_TEMPLATE/security-vulnerability.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ assignees: beanbeanjuice

---

**__Describe the Security Vulnerability__**
## Security Vulnerability Description
A clear and concise description of what you want to happen.

**__Additional Context__**
___

## Additional Context
Add any other context or screenshots about the security vulnerability here.

# Checklist:
___

## Checklist

- [ ] I have checked for similar issues.
- [ ] This is a security vulnerability report, not a feature request, improvement request, or a bug report.
19 changes: 18 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
# Contributing

When contributing to this repository, please first discuss the change you wish to make via issue,
When contributing to this repository, **please first discuss the change you wish to make via issue**,
email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

## Branching

Now, make sure you are forking off of/branching off of the `integration` branch located [here](https://github.com/beanbeanjuice/cafeBot/tree/integration). This allows new and upcoming changes to be pushed to a "working" directory rather than straight to the main, production directory. For example, this is how you may contribute.

Create a fork of the repository, and run the following commands in git CLI.

```
git switch integration
git checkout -b (issue-number)-(issue-name)
```

The above code switches to the `integration` branch, and creates a new branch based on the current `integration` branch. Then, you can create a pull request on GitHub with your forked repository, pushing the new branch onto the integration branch. So an example would be below;

```
git checkout -b 525-slash-commands-notification-spam
```

## Code Formatting

```JAVA
Expand Down
4 changes: 2 additions & 2 deletions README-small.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ As you can see, this was shown using the command `/help order`. It shows each pa
* `remove-my-data` - Request to remove your data from the bot!
* `stats` - Show statistics such as commands run, current servers, and users!
* `support` - Get support for the bot!
* `user-info` - Get user information about someone.
* `whois` - Get user information about someone.
##### 2. **CAFE**
* `balance` - Check your balance!
* `donate-beancoins` - Donate some of your `beanCoins` to someone! (Only up to 25 every hour though!)
Expand All @@ -128,8 +128,8 @@ As you can see, this was shown using the command `/help order`. It shows each pa
* `rate` - Rate the percentages of someone! (*somewhat* NSFW)
* `snipe` - Snipe a recently deleted message! (30 Seconds)
* `tea-meme` - Get a tea meme!
* `8ball` - Ask a yes or no question!
##### 4. **GAMES**
* `8-ball` - Ask a yes or no question!
* `coin-flip` - Flip a coin!
* `connect-4` - Play connect four with someone!
* `dice-roll` - Roll a dice!
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
<li><a href="#roadmap">Roadmap</a></li>
<li><a href="#contributing">Contributing</a></li>
<li><a href="#license">License</a></li>
<li><a href="#data">What data does this bot store?</a></li>
<li><a href="#privacy-policy">What data does this bot store?</a></li>
<li><a href="#terms-and-conditions">Terms and Conditions</a></li>
<li><a href="#contact">Contact</a></li>
<li><a href="#acknowledgements">Acknowledgements</a></li>
</ol>
Expand Down Expand Up @@ -126,7 +127,7 @@ This is an example of how to list things you need to use the software and how to
As you can see, this was shown using the command `/help order`. It shows each parameter you can run. For example, the first `<NUMBER>` is the `CATEGORY NUMBER` for the menu, needs to be a number, and is required. The `help` command also provides an example on how to actually use the command if you are stuck!

#### **Command Section**
*There are many command sections, with more coming soon. To show the commands in a specific section, do `!!help (command section)` or for example, `!!help moderation`!* Doing `!!help (command)` will also show you an example of how to use the command.
*There are many command sections, with more coming soon. To show the commands in a specific section, do `/help (command section)` or for example, `/help moderation`!* Doing `/help (command)` will also show you an example of how to use the command.

##### 1. **GENERIC**
* `bot-donate` - Donate for the bot!
Expand All @@ -143,7 +144,7 @@ As you can see, this was shown using the command `/help order`. It shows each pa
* `remove-my-data` - Request to remove your data from the bot!
* `stats` - Show statistics such as commands run, current servers, and users!
* `support` - Get support for the bot!
* `user-info` - Get user information about someone.
* `whois` - Get user information about someone.
##### 2. **CAFE**
* `balance` - Check your balance!
* `donate-beancoins` - Donate some of your `beanCoins` to someone! (Only up to 25 every hour though!)
Expand All @@ -161,8 +162,8 @@ As you can see, this was shown using the command `/help order`. It shows each pa
* `rate` - Rate the percentages of someone! (*somewhat* NSFW)
* `snipe` - Snipe a recently deleted message! (30 Seconds)
* `tea-meme` - Get a tea meme!
* `8ball` - Ask a yes or no question!
##### 4. **GAMES**
* `8-ball` - Ask a yes or no question!
* `coin-flip` - Flip a coin!
* `connect-4` - Play connect four with someone!
* `dice-roll` - Roll a dice!
Expand Down Expand Up @@ -248,7 +249,7 @@ Distributed under the GPL-3.0 License. See `LICENSE` for more information.
<!-- DATA THIS BOT STORES -->
# Privacy Policy

Here is ALL of the data that this bot could *possibly* store on you. This, of course, is subject to change. None of these can be accessed by other servers (that you are not a part of) by the bot.
Here is ALL of the data that this bot could *possibly* store on you. This, of course, is subject to change. None of these can be accessed by other servers (that you are not a part of) by the bot. The full policy can be viewed [here](https://www.beanbeanjuice.com/cafeBot/privacy_policy.html).

- *__Discord Data__*
- Your Discord ID.`*`
Expand All @@ -272,6 +273,11 @@ Here is ALL of the data that this bot could *possibly* store on you. This, of co
##### `**` - This is something that is needed for the bot to do things like apply a role to someone when they join a specific voice channel, or to duplicate a voice channel when needed.
##### `***` - Your birthday is only stored WHEN specified, and can even be removed at anytime by simply using the `/birthday remove` command.

<!-- Terms and Conditions -->
# Terms and Conditions

By using [cafeBot](https://www.github.com/beanbeanjuice/cafeBot), you are agreeing to the privacy policy and terms and conditions as stated [here](https://www.beanbeanjuice.com/cafeBot/terms_and_conditions.html). Again, other than the things you provide through commands, nothing is saved and no personal information is saved.

<!-- CONTACT -->
# Contact

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<dependency>
<groupId>com.github.twitch4j</groupId>
<artifactId>twitch4j</artifactId>
<version>1.10.0</version>
<version>1.12.0</version>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void handle(@NotNull SlashCommandInteractionEvent event) {

// Checking if the donatee was unable to be retrieved from the CafeAPI.
if (donatee == null) {
event.getChannel().sendMessageEmbeds(Helper.errorEmbed(
event.getHook().sendMessageEmbeds(Helper.errorEmbed(
"Error Getting User Information",
"There has been an error retrieving the specified user's information in the database."
)).queue();
Expand All @@ -65,7 +65,7 @@ public void handle(@NotNull SlashCommandInteractionEvent event) {

// Checking if the donator IS the donatee
if (donatee.getUserID().equals(donatorUser.getId())) {
event.getChannel().sendMessageEmbeds(Helper.errorEmbed(
event.getHook().sendMessageEmbeds(Helper.errorEmbed(
"Cannot Donate to Self",
"You cannot donate to yourself!"
)).queue();
Expand All @@ -74,7 +74,7 @@ public void handle(@NotNull SlashCommandInteractionEvent event) {

// Checking if the donator was unable to be retrieved from the CafeAPI.
if (donator == null) {
event.getChannel().sendMessageEmbeds(Helper.errorEmbed(
event.getHook().sendMessageEmbeds(Helper.errorEmbed(
"Error Getting User Information",
"There has been an error retrieving your user information in the database."
)).queue();
Expand All @@ -83,7 +83,7 @@ public void handle(@NotNull SlashCommandInteractionEvent event) {

// Making sure they can only donate the amount that is in their balance.
if (donator.getBeanCoins() < amountToDonate) {
event.getChannel().sendMessageEmbeds(Helper.errorEmbed(
event.getHook().sendMessageEmbeds(Helper.errorEmbed(
"Missing Balance",
"You don't have enough balance to donate that amount. You only have `" + donator.getBeanCoins() + "bC`."
)).queue();
Expand All @@ -94,7 +94,7 @@ public void handle(@NotNull SlashCommandInteractionEvent event) {
try {
Bot.getCafeAPI().CAFE_USER.updateCafeUser(donator.getUserID(), CafeType.BEAN_COINS, donator.getBeanCoins() - amountToDonate);
} catch (CafeException e) {
event.getChannel().sendMessageEmbeds(Helper.sqlServerError(
event.getHook().sendMessageEmbeds(Helper.sqlServerError(
"Error updating donation sender. There has been an error contacting the Cafe API."
)).queue();
Bot.getLogger().log(this.getClass(), LogLevel.ERROR, "Error Updating Donation Sender: " + e.getMessage(), e);
Expand All @@ -105,7 +105,7 @@ public void handle(@NotNull SlashCommandInteractionEvent event) {
try {
Bot.getCafeAPI().CAFE_USER.updateCafeUser(donatee.getUserID(), CafeType.BEAN_COINS, donatee.getBeanCoins() + amountToDonate);
} catch (CafeException e) {
event.getChannel().sendMessageEmbeds(Helper.sqlServerError(
event.getHook().sendMessageEmbeds(Helper.sqlServerError(
"Error updating donation receiver. There has been an error contacting the Cafe API."
)).queue();
Bot.getLogger().log(this.getClass(), LogLevel.ERROR, "Error Updating Donation Receiver: " + e.getMessage(), e);
Expand All @@ -122,7 +122,7 @@ public void handle(@NotNull SlashCommandInteractionEvent event) {
return;
}

event.getChannel().sendMessageEmbeds(moneyEmbed(donatorUser, donateeUser, donator, donatee, amountToDonate)).queue();
event.getHook().sendMessageEmbeds(moneyEmbed(donatorUser, donateeUser, donator, donatee, amountToDonate)).queue();
}

/**
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/com/beanbeanjuice/command/fun/AvatarCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,28 @@ public void handle(@NotNull SlashCommandInteractionEvent event) {
user = event.getOption("user").getAsUser();
name = user.getName();
url = user.getAvatarUrl();

if (url == null) {
event.getHook().sendMessageEmbeds(Helper.errorEmbed(
"No User Avatar",
"The specified user does not have a Discord avatar."
)).queue();
return;
}
} else {
Member member = event.getMember();
if (event.getOption("user") != null)
member = event.getOption("user").getAsMember();
name = member.getUser().getName();
url = member.getAvatarUrl();

if (url == null) {
event.getHook().sendMessageEmbeds(Helper.errorEmbed(
"No User Server Avatar",
"The specified user does not have a custom avatar for this server."
)).queue();
return;
}
}

event.getHook().sendMessageEmbeds(avatarEmbed(name, url)).queue();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.beanbeanjuice.command.games;
package com.beanbeanjuice.command.fun;

import com.beanbeanjuice.utility.command.CommandCategory;
import com.beanbeanjuice.utility.command.ICommand;
Expand Down Expand Up @@ -44,6 +44,7 @@ private String getAnswer() {
yesAnswers.add("Of course.");
yesAnswers.add("More than likely.");
yesAnswers.add("YES ABSOLUTELY.");
yesAnswers.add("Hmmm... I think so.");

ArrayList<String> noAnswers = new ArrayList<>();
noAnswers.add("Of course not.");
Expand All @@ -52,8 +53,9 @@ private String getAnswer() {
noAnswers.add("There is some doubt...");
noAnswers.add("Less than likely.");
noAnswers.add("ABSOLUTELY NOT.");
noAnswers.add("Are you kidding? No!");

if (Helper.getRandomNumber(1, 3) == 1)
if (Helper.getRandomNumber(0, 2) == 1)
return yesAnswers.get(Helper.getRandomNumber(0, yesAnswers.size()));
else
return noAnswers.get(Helper.getRandomNumber(0, noAnswers.size()));
Expand All @@ -62,13 +64,13 @@ private String getAnswer() {
@NotNull
@Override
public String getDescription() {
return "Ask 8-ball a yes or no question!";
return "Ask the 8 ball a yes or no question!";
}

@NotNull
@Override
public String exampleUsage() {
return "`/8-ball Will I ever be real?`";
return "`/8ball Will I ever be real?`";
}

@NotNull
Expand All @@ -82,7 +84,7 @@ public ArrayList<OptionData> getOptions() {
@NotNull
@Override
public CommandCategory getCategoryType() {
return CommandCategory.GAMES;
return CommandCategory.FUN;
}

@NotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private MessageEmbed messageEmbed(@NotNull Long botPing, @NotNull Long gatewayPi
.append("**OS Memory Usage** - `").append(systemMemoryUsage).append("` mb / `").append(systemMemoryTotal).append("` mb\n")
.append("**Bot Memory Usage** - `").append(dedicatedMemoryUsage).append("` mb / `").append(dedicatedMemoryTotal).append("` mb\n")
.append("**Bot Uptime** - `").append(Helper.millisToDays(ManagementFactory.getRuntimeMXBean().getUptime())).append("`\n")
.append("**Commands Run** - `").append(Bot.commandsRun).append("`\n")
.append("**Commands Run (After Restart)** - `").append(Bot.commandsRun).append("`\n")
.append("Hello there! How are you? Would you like to order some coffee?");

embedBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private MessageEmbed statsEmbed() {
.setAuthor("Bot Statistics", null, Bot.getBot().getSelfUser().getAvatarUrl())
.addField("<a:cafeBot:841945919926173707> Total Text Channels", "```" + Helper.getTotalChannels() + "```", true)
.addField("<:smartPeepo:1000248538376196280> Total Servers", "```" + Helper.getTotalServers() + "```", true)
.addField("⚙ Total Commands Run", "```" + Bot.commandsRun + "```", true)
.addField("⚙ Commands Run (After Restart)", "```" + Bot.commandsRun + "```", true)
.addField("<a:catpats:950514533875720232> Total Users", "```" + Helper.getTotalUsers() + "```", true)
.setFooter("If you are enjoying this bot, please consider using /bot-upvote!")
.build();
Expand Down

0 comments on commit 74caea9

Please sign in to comment.