From 6ac5827438e25d1fcae450e68a8147bcb847cbb0 Mon Sep 17 00:00:00 2001 From: Sinistral2099 <11929146+Sinistral2099@users.noreply.github.com> Date: Wed, 29 Nov 2023 10:19:32 -0600 Subject: [PATCH 1/2] Added new Global Variable and Argument Methods. --- streamerbot/3.api/3.csharp/core/variables.md | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/streamerbot/3.api/3.csharp/core/variables.md b/streamerbot/3.api/3.csharp/core/variables.md index 923d8299..c868e6d4 100644 --- a/streamerbot/3.api/3.csharp/core/variables.md +++ b/streamerbot/3.api/3.csharp/core/variables.md @@ -12,6 +12,15 @@ Arguments are local variables only available to the currently running action and Set an argument to be used in subsequent sub-actions :csharp-method{name=SetArgument} +::callout{icon=i-mdi-alert color=amber} +The following Methods require the `0.2.3-alpha`. +:: + +### `TryGetArg` +:csharp-method{name=TryGetArg} + + + ## Globals ### `GetGlobalVar` Fetch the current value of a global variable @@ -25,6 +34,30 @@ Set a global variable value Unset a global variable value :csharp-method{name=UnsetGlobalVar} +::callout{icon=i-mdi-alert color=amber} +The following Methods require the `0.2.3-alpha`. +:: + +### `ClearNonPersistedGlobals` +:csharp-method{name=ClearNonPersistedGlobals} + +### `ClearNonPersistedUserGlobals` +:csharp-method{name=ClearNonPersistedUserGlobals} + +### `GetGlobalVarValues` +Get a list of all Global Variables. +:csharp-method{name=GetGlobalVarValues} + +### The `GlobalVariableValue` class +```cs +public class GlobalVariableValue +{ + public string VariableName { get; set; } + public object Value { get; set; } + public DateTime LastWrite { get; set; } +} +``` + ## User Variables (Twitch) ### `GetTwitchUserVar` Fetch a variable for a given Twitch user From dc2377f795b083fe8eb572e34830bbf17c38b476 Mon Sep 17 00:00:00 2001 From: Sinistral2099 <11929146+Sinistral2099@users.noreply.github.com> Date: Wed, 29 Nov 2023 10:45:03 -0600 Subject: [PATCH 2/2] Add new Twitch User methods. --- streamerbot/3.api/3.csharp/twitch/users.md | 84 +++++++++++++++++++++- 1 file changed, 81 insertions(+), 3 deletions(-) diff --git a/streamerbot/3.api/3.csharp/twitch/users.md b/streamerbot/3.api/3.csharp/twitch/users.md index c557cc32..5bd4ef6a 100644 --- a/streamerbot/3.api/3.csharp/twitch/users.md +++ b/streamerbot/3.api/3.csharp/twitch/users.md @@ -3,8 +3,86 @@ title: Users description: Fetch Twitch user information from your code actions --- -## `TwitchIsUserSubscribed` +## Methods + +::callout{icon=i-mdi-alert color=amber} +The following Method requires the `0.2.3-alpha`. +:: +### `TwitchGetBot` +:csharp-method{name=TwitchGetBot} + +### `TwitchGetBroadcaster` +:csharp-method{name=TwitchGetBroadcaster} + +### `TwitchGetExtendedUserInfoById` +:csharp-method{name=TwitchGetExtendedUserInfoById} + +### `TwitchGetExtendedUserInfoByLogin` +:csharp-method{name=TwitchGetExtendedUserInfoByLogin} + +### `TwitchIsUserSubscribed` :csharp-method{name=TwitchIsUserSubscribed} -## `TwitchGetBitsDonatedByUserId` -:csharp-method{name=TwitchGetBitsDonatedByUserId} \ No newline at end of file +### `TwitchGetBitsDonatedByUserId` +:csharp-method{name=TwitchGetBitsDonatedByUserId} + +### `TwitchGetUserInfoById` +:csharp-method{name=TwitchGetUserInfoById} + +### `TwitchGetUserInfoByLogin` +:csharp-method{name=TwitchGetUserInfoByLogin} + +## Classes +### The `TwitchUserInfo` Class +```cs +public class TwitchUserInfo +{ + public string UserName { get; set; } + public string UserLogin { get; set; } + public string UserId { get; set; } + + public DateTime LastActive { get; set; } + public DateTime PreviousActive { get; set; } + public bool IsSubscribed { get; set; } + public string SubscriptionTier { get; set; } + + public bool IsModerator { get; set; } + public bool IsVip { get; set; } +} +``` + +### The `TwitchUserInfoEx` Class +```cs +public class TwitchUserInfoEx +{ + public string UserName { get; set; } + public string UserLogin { get; set; } + public string UserId { get; set; } + public string Description { get; set; } + public string ProfileImageUrl { get; set; } + public string UserType { get; set; } + public bool IsPartner => string.Equals(UserType, "partner", StringComparison.OrdinalIgnoreCase); + + public bool IsAffiliate => string.Equals(UserType, "affiliate", StringComparison.OrdinalIgnoreCase); + + public bool IsFollowing { get; set; } + public DateTime LastActive { get; set; } + public DateTime PreviousActive { get; set; } + public bool IsSubscribed { get; set; } + public string SubscriptionTier { get; set; } + + public bool IsModerator { get; set; } + public bool IsVip { get; set; } + + public DateTime CreatedAt { get; set; } + public double AccountAge { get; set; } + + public string Game { get; set; } + public string GameId { get; set; } + + public string ChannelTitle { get; set; } + + public List Tags { get; set; } +} +``` +