Skip to content

Commit

Permalink
Merge pull request #5 from beanbeanjuice/integration
Browse files Browse the repository at this point in the history
Updated the Kawaii API Wrapper
  • Loading branch information
beanbeanjuice authored Jul 16, 2022
2 parents d3ab486 + 4d73a6a commit d86aa0f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Fixes # (issue)

- [ ] This pull request has been linked to the appropriate issue on GitHub. (Use the development section on the right.)
- [ ] The code follows the style [guidlines](https://github.com/beanbeanjuice/cafeBot/blob/master/CONTRIBUTING.md).
- [ ] A self-review of the code was performed in GitHub.
- [ ] Appropriate comments were added in the code.
- [ ] A self-review of the code was performed on GitHub.
- [ ] Appropriate comments and javadocs were added to your code.
- [ ] Appropriate changes have been made to the documentation.
- [ ] Appropriate changes have been made to the `README.md` file.
- [ ] No warnings are produced when the code is run.
Expand Down
22 changes: 19 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![wakatime](https://wakatime.com/badge/github/beanbeanjuice/Java-Kawaii-API-Wrapper.svg?style=for-the-badge)](https://wakatime.com/badge/github/beanbeanjuice/Java-Kawaii-API-Wrapper)
[![CodeFactor](https://www.codefactor.io/repository/github/beanbeanjuice/java-kawaii-api-wrapper/badge?style=for-the-badge)](https://www.codefactor.io/repository/github/beanbeanjuice/java-kawaii-api-wrapper)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/beanbeanjuice/Java-Kawaii-API-Wrapper?style=for-the-badge)
![Maven Central](https://img.shields.io/maven-central/v/com.beanbeanjuice/kawaii-api-wrapper?color=%23CBC3E3&style=for-the-badge)

<!-- PROJECT LOGO -->
<br />
Expand Down Expand Up @@ -55,11 +55,27 @@
<!-- GETTING STARTED -->
# Getting Started

To add this bot to your server, follow these steps.
## Usage

*For Anonymous Requests...*
```Java
KawaiiAPI kawaiiAPI = new KawaiiAPI();
kawaiiAPI.GIF.getGIF("hug");
```

*For Normal Requests...*
```Java
KawaiiAPI kawaiiAPI = new KawaiiAPI(TOKEN_HERE);
kawaiiAPI.GIF.getGIF("hug");
```

Currently, the supported "prompts" are located [here](https://docs.kawaii.red/endpoints/gif). I have no control over the actual endpoint list.

## Installation

Make sure you replace VERSION with the appropriate version.
![Maven Central](https://img.shields.io/maven-central/v/com.beanbeanjuice/kawaii-api-wrapper?color=%23CBC3E3)

Make sure you replace VERSION with the appropriate version specified above.

For `Maven`, paste this into your `dependencies` section of your `pom.xml` file.
```XML
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<maven.compiler.target>16</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<version.number>1.1.0</version.number>
<version.number>1.1.1</version.number>
</properties>

<profiles>
Expand Down
19 changes: 16 additions & 3 deletions src/main/java/com/beanbeanjuice/KawaiiAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,35 @@
import org.jetbrains.annotations.NotNull;

/**
* A class used for the KawaiiAPI
* A class used for the {@link KawaiiAPI}.
*
* @author beanbeanjuice
* @since v1.0.0
* @since 1.1.1
*/
public class KawaiiAPI {

public GifEndpoint GIF;

/**
* Create a new {@link KawaiiAPI} object.
* @param token The {@link String token} for keeping track of statistics. Can be "anonymous".
* @param token The {@link String token} for keeping track of statistics.
* @see <a href="https://docs.kawaii.red/tutorials/token">Token</a>
* @see <a href="https://docs.kawaii.red/">Kawaii API Documentation</a>
*/
public KawaiiAPI(@NotNull String token) {
initialiseEndPoints(token);
}

/**
* Create a new, anonymous, {@link KawaiiAPI} object.
* @see <a href="https://docs.kawaii.red/tutorials/token">Token</a>
* @see <a href="https://docs.kawaii.red/">Kawaii API Documentation</a>
*/
public KawaiiAPI() {
initialiseEndPoints("anonymous");
}

private void initialiseEndPoints(@NotNull String token) {
GIF = new GifEndpoint(token);
}

Expand Down

0 comments on commit d86aa0f

Please sign in to comment.