Skip to content

Commit

Permalink
chore: replace variable examples (#2913)
Browse files Browse the repository at this point in the history
* chore: move imports

* chore: remove redundant usages

* chore: semantics

* chore: quotes

* chore: typo

* chore: fix currencyRank usage
  • Loading branch information
dennisrijsdijk authored Nov 29, 2024
1 parent ea0e6ec commit c3ec9dc
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 26 deletions.
6 changes: 0 additions & 6 deletions src/backend/variables/builtin/counter/counter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ const model: ReplaceVariable = {
handle: "counter",
usage: "counter[name]",
description: "Displays the value of the given counter.",
examples: [
{
usage: "counter[name]",
description: "Returns the value of the specified counter"
}
],
categories: [VariableCategory.NUMBERS],
possibleDataOutput: [OutputDataType.NUMBER]
},
Expand Down
2 changes: 1 addition & 1 deletion src/backend/variables/builtin/currency/currency-rank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const model : ReplaceVariable = {
definition: {
handle: "currencyRank",
description: "Returns the rank of the current user based on how much of the given currency they have.",
usage: "currencyRank[currencyName, username]",
usage: "currencyRank[currencyName]",
examples: [
{
usage: "currencyRank[currencyName, username]",
Expand Down
2 changes: 1 addition & 1 deletion src/backend/variables/builtin/currency/currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const model : ReplaceVariable = {
examples: [
{
usage: "currency[currencyName, username]",
description: "Returns the amount of specified currency the given user fas"
description: "Returns the amount of specified currency the given user has"
}
],
categories: [VariableCategory.USER, VariableCategory.NUMBERS],
Expand Down
2 changes: 2 additions & 0 deletions src/backend/variables/builtin/metadata/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import commandTrigger from './command-trigger';
import count from './count';
import effectOutput from './effect-output';
import effectQueueId from './effect-queue-id';
import effectQueueLength from './effect-queue-length';
import effectQueueName from './effect-queue-name';
import effectQueueStatus from './effect-queue-status';
import overlayInstance from './overlay-instance';
Expand All @@ -26,6 +27,7 @@ export default [
count,
effectOutput,
effectQueueId,
effectQueueLength,
effectQueueName,
effectQueueStatus,
overlayInstance,
Expand Down
6 changes: 3 additions & 3 deletions src/backend/variables/builtin/number/math.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ const logger = require("../../../logwrapper");
const model : ReplaceVariable = {
definition: {
handle: "math",
usage: "math[expression]",
usage: "math[expression]",
description: 'Evaluate a math equation using <a href="https://mathjs.org/docs/index.html">math.js</a>',
examples: [
{
usage: "math[2 + 2]",
description: "Simple addition calculation returns 4"
description: `Returns 4`
},
{
usage: "math[5 * (3 + 2)]",
description: "Complex calculation returns 25"
description: `Returns 25`
}
],
categories: [VariableCategory.COMMON, VariableCategory.NUMBERS],
Expand Down
2 changes: 1 addition & 1 deletion src/backend/variables/builtin/number/number-commafy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const model : ReplaceVariable = {
examples: [
{
usage: "commafy[1000000]",
description: "Returns \"1,000,000\""
description: `Returns "1,000,000"`
}
],
categories: [VariableCategory.NUMBERS],
Expand Down
4 changes: 0 additions & 4 deletions src/backend/variables/builtin/number/number-floor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ const model : ReplaceVariable = {
{
usage: "floor[3.7]",
description: "Returns 3"
},
{
usage: "floor[$presetListArg[Number]]",
description: "Rounds down the preset list argument value"
}
],
categories: [VariableCategory.NUMBERS],
Expand Down
2 changes: 1 addition & 1 deletion src/backend/variables/builtin/number/number-max.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { OutputDataType, VariableCategory } from "../../../../shared/variable-co
const model : ReplaceVariable = {
definition: {
handle: "max",
description: "Returns the highest-value numbered passed",
description: "Returns the highest-value number",
usage: "max[num1, num2, ...]",
examples: [
{
Expand Down
2 changes: 1 addition & 1 deletion src/backend/variables/builtin/number/number-min.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { OutputDataType, VariableCategory } from "../../../../shared/variable-co
const model : ReplaceVariable = {
definition: {
handle: "min",
description: "Returns the lowest-value numbered passed",
description: "Returns the lowest-value number",
usage: "min[num1, num2, ...]",
examples: [
{
Expand Down
6 changes: 5 additions & 1 deletion src/backend/variables/builtin/text/text-capitalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ import { OutputDataType, VariableCategory } from "../../../../shared/variable-co
const model : ReplaceVariable = {
definition: {
handle: "capitalize",
description: "Capitalizes the given text.",
description: "Capitalizes the first letter of the given text, converting the rest into lowercase",
usage: "capitalize[text]",
examples: [
{
usage: `capitalize["hello world"]`,
description: `Returns "Hello world".`
},
{
usage: `capitalize["HELLO WORLD"]`,
description: `Returns "Hello world".`
}
],
categories: [VariableCategory.TEXT],
Expand Down
2 changes: 1 addition & 1 deletion src/backend/variables/builtin/text/text-decode-from-url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const model : ReplaceVariable = {
examples: [
{
usage: `decodeFromUrl["Hello%20World%21"]`,
description: "Returns Hello World!"
description: `Returns "Hello World!"`
}
],
categories: [VariableCategory.TEXT],
Expand Down
2 changes: 2 additions & 0 deletions src/backend/variables/builtin/twitch/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import rewardVariables from './reward';
import streamVariables from './stream';
import subVariables from './subs';

import accountCreationDate from './account-creation-date';
import followAge from './follow-age';
import followCount from './follow-count';
import predictionWinningOutcomeName from './prediction-winning-outcome-name';
Expand All @@ -32,6 +33,7 @@ export default [
...streamVariables,
...subVariables,

accountCreationDate,
followAge,
followCount,
predictionWinningOutcomeName,
Expand Down
2 changes: 0 additions & 2 deletions src/backend/variables/builtin/user/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import accountCreationDate from '../twitch/account-creation-date';
import chatMessages from './chat-messages';
import isUserInChat from './is-user-in-chat';
import metadataKey from './metadata-key';
Expand All @@ -25,7 +24,6 @@ import roleVariables from './roles';
import rankVariables from './ranks';

export default [
accountCreationDate,
chatMessages,
isUserInChat,
metadataKey,
Expand Down
2 changes: 0 additions & 2 deletions src/backend/variables/builtin/utility/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import fileLineCount from './file-line-count';
import fileName from './file-name';
import fileRead from './file-read';
import filesInDirectory from './files-in-directory';
import getEffectQueueLength from "../metadata/effect-queue-length";
import loopCount from './loop-count';
import loopItem from './loop-item';
import quickstore from './quick-store';
Expand All @@ -31,7 +30,6 @@ export default [
fileName,
fileRead,
filesInDirectory,
getEffectQueueLength,
loopCount,
loopItem,
quickstore,
Expand Down
4 changes: 2 additions & 2 deletions src/backend/variables/builtin/utility/video-duration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ const model : ReplaceVariable = {
description: "Attempts to retrieve video duration.",
examples: [
{
usage: "videoDuration[\"path/to/video.mp4\"]",
usage: `videoDuration["path/to/video.mp4"]`,
description: "Returns the duration of the video file in seconds."
},
{
usage: "videoDuration[\"https://example.com/video.mp4\"]",
usage: `videoDuration["https://example.com/video.mp4"]`,
description: "Returns the duration of the video file from a URL in seconds."
}
],
Expand Down

0 comments on commit c3ec9dc

Please sign in to comment.