Skip to content

Commit

Permalink
Add ReadMe.md
Browse files Browse the repository at this point in the history
  • Loading branch information
breadbott committed Dec 22, 2024
1 parent b108053 commit 7c713a9
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# YouTube-Live-Chat-API

## Installation

1. Add YouTube-Live-Chat-API as a dependency to your project.

Gradle:
```groovy
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.breadbott:YouTube-Live-Chat-API:1.0.0'
}
```

maven:
```xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>com.github.breadbott</groupId>
<artifactId>YouTube-Live-Chat-API</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>

```


2. Generate a YouTube API token or an OAuth token at the [Google Cloud Console](https://console.cloud.google.com).

3. Make a new YouTubeLive instance. [see examples](https://github.com/breadbott/Youtube-Live-Chat-API/blob/master/src/test/java/com/breadbot/YouTubeBot.java)
```java
YouTubeLive.newClient()
.apiKey("API-KEY")
// Or optionally oAuthToken.
//.oAuthToken("OAUTH-TOKEN")
// Use events here.
.onTextMessage((event, client) -> {
String sender = event.getAuthorChannelName();
String message = event.getMessageText();
System.out.println(sender+" > "+message);
})
.buildAndConnect(liveStreamId);
```

## More features to come!

0 comments on commit 7c713a9

Please sign in to comment.