Skip to content

Commit

Permalink
Merge pull request #13 from Sinistral2099/main
Browse files Browse the repository at this point in the history
Add new Global Variable, Argument, and Twitch User methods.
  • Loading branch information
Ik1497 authored Nov 30, 2023
2 parents c7c5678 + dc2377f commit 1ad6aae
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 3 deletions.
33 changes: 33 additions & 0 deletions streamerbot/3.api/3.csharp/core/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
84 changes: 81 additions & 3 deletions streamerbot/3.api/3.csharp/twitch/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}
### `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<string> Tags { get; set; }
}
```

0 comments on commit 1ad6aae

Please sign in to comment.