Skip to content

Commit

Permalink
fix:renames method to vod, fixes example example imports, updates REA…
Browse files Browse the repository at this point in the history
…DME with new feature example
  • Loading branch information
retconned committed Oct 9, 2024
1 parent f5ae8d0 commit 85e6bad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ client.login({ process.env.TOKEN, process.env.COOKIES });
client.on("ChatMessage", async (message) => {
console.log(`${message.sender.username}: ${message.content}`);
});

// get information about a vod
// your-video-id = vod uuid
const { title, duration, thumbnail, views } = await client.vod("your-video-id");
```

## Disclaimer :warning:
Expand Down
9 changes: 3 additions & 6 deletions examples/basic-bot.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// import { createClient, type MessageData } from "@retconned/kick-js";

import { createClient } from "../src/client/client";
import type { MessageData } from "../src/types/events";
import { createClient, type MessageData } from "@retconned/kick-js";

const client = createClient("xqc", { logger: true });

Expand Down Expand Up @@ -43,5 +40,5 @@ client.on("Subscription", async (subscription) => {
console.log(`New subscription 💰 : ${subscription.username}`);
});

const { title, duration, thumbnail, views } =
await client.video("your-video-id");
// get information about a vod
const { title, duration, thumbnail, views } = await client.vod("your-video-id");
2 changes: 1 addition & 1 deletion src/types/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface Video {

export interface KickClient {
on: (event: string, listener: (...args: any[]) => void) => void;
video: (video_id: string) => Promise<Video>;
vod: (video_id: string) => Promise<Video>;
login: (credentials: { token: string; cookies: string }) => Promise<void>;
user: {
id: number;
Expand Down

0 comments on commit 85e6bad

Please sign in to comment.