Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/motoki317/traq4j
traQ API client for Java
https://github.com/motoki317/traq4j
traq
Last synced: 2 months ago
JSON representation
traQ API client for Java
- Host: GitHub
- URL: https://github.com/motoki317/traq4j
- Owner: motoki317
- License: mit
- Created: 2020-06-05T14:09:23.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-05-21T02:25:26.000Z (over 2 years ago)
- Last Synced: 2024-08-02T14:06:41.225Z (5 months ago)
- Topics: traq
- Language: Java
- Homepage:
- Size: 9.83 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# traq4j
[![GitHub release](https://img.shields.io/github/release/motoki317/traq4j.svg)](https://GitHub.com/motoki317/traq4j/releases/)
traQ API client for Java
Requires Java 8+
## Example usage
### pom.xml
Make sure to use the latest version shown below.
[![GitHub release](https://img.shields.io/github/release/motoki317/traq4j.svg)](https://GitHub.com/motoki317/traq4j/releases/)
```xml
GitHub traq4j
https://raw.github.com/motoki317/traq4j/mvn-repo/
com.github.motoki317
traq4j
${traq4j.version}
```
### Code
```java
public class Main {
public static void main(String[] args){
// Create API client
String accessToken = System.getenv("ACCESS_TOKEN");
ApiClient client = new ApiClient();
client.addDefaultHeader("Authorization", "Bearer " + accessToken);// Message API client
MessageApi messageApi = new MessageApi(client);// Post message
String channelId = "00000000-0000-0000-0000-000000000000";
String content = "oisu~";
Message message = messageApi.postMessage(
UUID.fromString(channelId),
new PostMessageRequest().content(content).embed(false)
);
assert message != null;
}
}
```## Development
1. `$ ./generate.sh`
2. Reformat code (takes some time)