@lumiastream/lumia-types 3.3.0 → 3.3.1

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.
@@ -13,28 +13,43 @@ title: Important notes
13
13
  The different options are: `isSelf, mod, vip, tier3, tier2, tier1, subscriber, follower`.
14
14
  In your code you should use `const levels = await getVariable('userLevelsRaw');` and then you can check a level with `if (levels.subscriber) {}` since these are all booleans
15
15
 
16
- - We also expose `{{originType}}` so your custom code can tell where the activity came from. Use `const originType = await getVariable('originType');` when you need to branch between alerts and command-based triggers.
17
- Common values are: `alert`, `chat`, `chatbot`, `twitch-points`, `twitch-extension`, `kick-points`, `system`, and `api`.
18
- Important: "commands" are not a single origin type. If you want to run only for command-style triggers you will usually want to check for a list like `chat`, `chatbot`, `twitch-points`, `twitch-extension`, and `kick-points`.
16
+ ## Origin and queue type variables
17
+
18
+ We expose `{{originType}}` and `{{queueType}}` so custom code can tell where an activity came from and what kind of queued activity is running.
19
+
20
+ Use `originType` when you want to branch by the source of the activity. Use `queueType` when you need the specific command category that Lumia is executing.
21
+
22
+ | Variable | What it means | Common values |
23
+ | --- | --- | --- |
24
+ | `originType` | Where the activity came from. This controls queue priority and groups similar sources together. | `alert`, `chat`, `chatbot`, `twitch-points`, `twitch-extension`, `kick-points`, `system`, `api`, `streamdeck`, `touchportal`, `loupedeck`, `avermedia`, `lumiastreamlink` |
25
+ | `queueType` | The specific queued command/activity type. This is the best value to check when you need to distinguish a normal chat command from a chat match. | `alert`, `chat-command`, `chatbot-command`, `chat-match`, `twitch-points`, `twitch-points-output`, `twitch-extension`, `twitch-extension-hfx`, `kick-points` |
26
+
27
+ Important: "commands" are not a single `originType`. A normal chat command uses `originType: "chat"` and `queueType: "chat-command"`, while a chat match also uses `originType: "chat"` but uses `queueType: "chat-match"`.
19
28
 
20
29
  ```js
21
30
  async function() {
22
31
  const originType = await getVariable('originType');
23
- const commandOrigins = ['chat', 'chatbot', 'twitch-points', 'twitch-extension', 'kick-points'];
32
+ const queueType = await getVariable('queueType');
24
33
 
25
- if (originType === 'alert') {
26
- chatbot({ message: 'This custom code was triggered by an alert.' });
34
+ if (queueType === 'chat-match') {
35
+ log('This ran from a chat match.');
27
36
  done();
28
37
  return;
29
38
  }
30
39
 
31
- if (commandOrigins.includes(originType)) {
32
- chatbot({ message: `Command trigger detected from ${originType}.` });
40
+ if (queueType === 'chat-command') {
41
+ log('This ran from a normal chat command.');
42
+ done();
43
+ return;
44
+ }
45
+
46
+ if (originType === 'alert') {
47
+ log('This ran from an alert.');
33
48
  done();
34
49
  return;
35
50
  }
36
51
 
37
- log(`Skipping custom code for originType: ${originType}`);
52
+ log(`Skipping custom code for originType=${originType}, queueType=${queueType}`);
38
53
  done();
39
54
  }
40
55
  ```
@@ -20,6 +20,7 @@ export interface ILumiaSendPack {
20
20
  username?: string;
21
21
  bits?: number;
22
22
  originType?: LumiaActivityOriginTypes;
23
+ queueType?: LumiaActivityCommandTypes;
23
24
  };
24
25
  };
25
26
  }
@@ -734,6 +734,7 @@ exports.ReservedVariables = [
734
734
  'value',
735
735
  'site',
736
736
  'originType',
737
+ 'queueType',
737
738
  'command',
738
739
  'merch',
739
740
  'message',
@@ -952,6 +953,7 @@ exports.AllVariables = {
952
953
  'channelDescription',
953
954
  'channelViews',
954
955
  'originType',
956
+ 'queueType',
955
957
  'command',
956
958
  'message',
957
959
  'messageId',
@@ -977,6 +979,7 @@ exports.AllVariables = {
977
979
  'channelDescription',
978
980
  'channelViews',
979
981
  'originType',
982
+ 'queueType',
980
983
  'command',
981
984
  'message',
982
985
  'messageId',
@@ -998,6 +1001,7 @@ exports.AllVariables = {
998
1001
  'channelDescription',
999
1002
  'channelViews',
1000
1003
  'originType',
1004
+ 'queueType',
1001
1005
  'command',
1002
1006
  'prompt',
1003
1007
  'message',
@@ -1015,6 +1019,7 @@ exports.AllVariables = {
1015
1019
  'channelDescription',
1016
1020
  'channelViews',
1017
1021
  'originType',
1022
+ 'queueType',
1018
1023
  'command',
1019
1024
  'prompt',
1020
1025
  'message',
@@ -1032,6 +1037,7 @@ exports.AllVariables = {
1032
1037
  'channelDescription',
1033
1038
  'channelViews',
1034
1039
  'originType',
1040
+ 'queueType',
1035
1041
  'command',
1036
1042
  'prompt',
1037
1043
  'message',
@@ -1042,7 +1048,7 @@ exports.AllVariables = {
1042
1048
  'points_cost',
1043
1049
  ],
1044
1050
  fileWatcher: ['content', 'file', 'path', 'timestamp'],
1045
- chatmatch: ['language_detect_result', 'detected_language', 'detected_language_code'],
1051
+ chatmatch: ['originType', 'queueType', 'language_detect_result', 'detected_language', 'detected_language_code'],
1046
1052
  commands: [
1047
1053
  'get_all_commands',
1048
1054
  'get_commands',
@@ -1055,6 +1061,7 @@ exports.AllVariables = {
1055
1061
  'channelDescription',
1056
1062
  'channelViews',
1057
1063
  'originType',
1064
+ 'queueType',
1058
1065
  'command',
1059
1066
  'message',
1060
1067
  'messageId',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/lumia-types",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "files": [