Skip to content

Commit

Permalink
docs: update sendMessage, add getUserPronouns`
Browse files Browse the repository at this point in the history
  • Loading branch information
Whipstickgostop committed Oct 19, 2024
1 parent 4c0507d commit 7876e72
Showing 1 changed file with 82 additions and 4 deletions.
86 changes: 82 additions & 4 deletions apps/docs/content/3.api/1.requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,18 @@ _Requires Streamer.bot v0.2.5_
Send a chat message to the selected platform

#### Signature
`sendMessage(platform: 'twitch' | 'youtube' | 'trovo', message: string, bot = false, internal = true): Promise<SendMessageResponse>`{lang=ts}
```ts
sendMessage(
platform: 'twitch' | 'youtube' | 'trovo',
message: string,
options?: {
bot?: boolean;
internal?: boolean;
replyId?: string;
broadcastId?: string;
}
): Promise<SendMessageResponse>
```

#### Parameters
::field-group
Expand All @@ -932,16 +943,26 @@ Send a chat message to the selected platform
::field{name=message type=string required}
Enter the content of the message to send
::
::field{name=bot type=boolean default=false}
::field{name=options.bot type=boolean default=false}
- Default: `false`{lang=ts}
Send with the bot account?
::
::field{name=internal type=boolean default=true}
::field{name=options.internal type=boolean default=true}
- Default: `true`{lang=ts}
Send as an `Internal` message

Useful in combination with the `Ignore Internal` option on [Commands](https://docs.streamer.bot/guide/commands)
::
::field{name=options.replyId type=string}
Optional message id to send a reply to

_Currently only supported by Twitch_
::
::field{name=options.broadcastId type=string}
Optioanl broadcast id to send the message to

_Currently only supported by YouTube_
::
::

#### Response Type
Expand All @@ -962,6 +983,63 @@ type SendMessageResponse = StreamerbotResponse<{
const response = await client.sendMessage('twitch', 'Hello, world!');

// Send a message with the Twitch bot account
const response = await client.getUserGlobal('twitch', 'Hello, from bot account!', true);
const response = await client.getUserGlobal('twitch', 'Hello, from bot account!', { bot: true });
```
::

## `getUserPronouns`
_Requires Streamer.bot v0.2.5_

Fetch user pronouns (alejo.io)

#### Signature
`getUserPronouns(platform: 'twitch' | 'youtube' | 'trovo', userLogin: string)`{lang=ts}

#### Parameters
::field-group
::field{name=platform type="'twitch' | 'youtube' | 'trovo'" required}
Select the platform to fetch pronouns for

_Currently only supported by Twitch_
::
::field{name=userLogin type=string required}
Provide the specific user login to fetch pronouns for
::
::

#### Response Type
::code-group
```ts [GetUserPronounsResponse.ts]
export type GetUserPronounsResponse = StreamerbotResponse<{
status: 'ok';
userLogin: string;
pronoun: {
pronouns: string;
pronounSubject: string;
pronounObject: string;
pronounPossessive: string;
pronounPronoun: string;
pronounReflexive: string;
pronounPastTense: string;
pronounSubjectLower: string;
pronounObjectLower: string;
pronounPossessiveLower: string;
pronounPronounLower: string;
pronounReflexiveLower: string;
pronounPastTenseLower: string;
pronounCurrentTense: string;
pronounCurrentTenseLower: string;
pronounPluralLower: string;
pronounLastCached: string;
userFound: boolean;
};
}>
```
::
#### Examples
::code-group
```ts [Request]
const response = await client.getUserPronouns('twitch', 'whipstickgostop');
```
::

0 comments on commit 7876e72

Please sign in to comment.