@overlaysymphony/twitch 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overlaysymphony/twitch",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Twitch module for the OverlaySymphony interactive streaming framework.",
5
5
  "homepage": "https://github.com/OverlaySymphony/overlaysymphony",
6
6
  "repository": {
@@ -18,7 +18,7 @@
18
18
  "./package.json": "./package.json"
19
19
  },
20
20
  "dependencies": {
21
- "@overlaysymphony/core": "0.2.1"
21
+ "@overlaysymphony/core": "0.2.2"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@vitest/coverage-v8": "^2.1.2",
package/src/chat/chat.ts CHANGED
@@ -7,7 +7,7 @@ type ChatMessage = EventPayload<"channel.chat.message">["event"]
7
7
  type ChatCommand = ChatMessage & {
8
8
  message: {
9
9
  command: string
10
- parameters?: string[]
10
+ parameters?: string
11
11
  } & ChatMessage["message"]
12
12
  }
13
13
 
@@ -54,15 +54,13 @@ export default async function createChat(
54
54
  const regex = /^\s*!([a-z0-9]+)(?:\s+(.+))?$/i
55
55
 
56
56
  return onMessage((payload) => {
57
- const [, command, text] =
57
+ const [, command, parameters] =
58
58
  payload.message.text.match(regex) ?? ([] as Array<string | undefined>)
59
59
 
60
60
  if (command !== name) {
61
61
  return
62
62
  }
63
63
 
64
- const parameters = text?.split(" ")
65
-
66
64
  callback({
67
65
  ...payload,
68
66
  message: {
@@ -33,17 +33,17 @@ const pronouns: Record<string, Pronouns> = {
33
33
  },
34
34
  shethem: {
35
35
  subject: "she",
36
- object: "they",
36
+ object: "them",
37
37
  posessive: "their",
38
38
  },
39
39
  hethem: {
40
40
  subject: "he",
41
- object: "they",
41
+ object: "them",
42
42
  posessive: "their",
43
43
  },
44
44
  heshe: {
45
45
  subject: "he",
46
- object: "she",
46
+ object: "her",
47
47
  posessive: "their",
48
48
  },
49
49
  xexem: {
@@ -123,10 +123,7 @@ export async function getUserPronouns(
123
123
  export async function getPronouns(
124
124
  login: string,
125
125
  fallback: keyof typeof pronouns = "theythem",
126
- ): Promise<{
127
- subject: string
128
- object: string
129
- }> {
126
+ ): Promise<Pronouns> {
130
127
  if (!(login in cache)) {
131
128
  try {
132
129
  const id = await getUserPronouns(login)
@@ -93,7 +93,7 @@ export async function sendChatMessage(
93
93
  }
94
94
  >(authentication, {
95
95
  method: "POST",
96
- path: "/chat/message",
96
+ path: "/chat/messages",
97
97
  params: {
98
98
  sender_id: authentication.user.id,
99
99
  broadcaster_id,