pilky / twitchmata Goto Github PK
View Code? Open in Web Editor NEWA set of files to help simplify integrating Twitch with an Animata VIPO stream built in Unity
License: MIT License
A set of files to help simplify integrating Twitch with an Animata VIPO stream built in Unity
License: MIT License
Add a dedicated type to hold user information coalesced from subs, raids, followers, chatters, mods and broadcasters
Create a type to hold info on bit redeems. This should be passed to notifications via the BitsManager
Add a dedicated type to hold info on a Raid and send via the notification function of the RaidManager
Implement methods to enable/disable a reward, as well as updating its cost and title
Create and use a custom reward redemption type that uses the twitchmata redeem for the ChannelPointManager notification
Add commands that generate test messages for features of a feature manager
The error for trying to manage a reward you don't have access to isn't very clear, so add a better error for it.
Add ability to register a chat command name, permissions, and call back with ChatCommandManager. On receiving a chat command, these should be checked for the name, that the permissions match, and then call the callback
Document all public APIs in Twitchmata source code
Add a field to Managed Rewards that includes a list of valid inputs. When validating permissions also validate against the inputs.
Add methods to the ChannelPointManager to manually fulfil or cancel a subscription
When we have a dedicated User object, have the Follow command pass one rather than Twitchmata arguments
Add a convenience method for RegisterReward that lets you skip the step of creating the reward and adding to a group and instead does it all in one line, returning a newly created ManagedReward
Some streamers may want certain channel rewards not to auto-complete so they can keep track of them in the dashboard. Add an option to rewards to disable the auto-completion
Add ability to listen for certain things in messages. This should take the form of message listeners that can be created to either exactly match, contain, or regex match messages
Pass the reward that was called as part of the channel point redemption
Add support for built-in lurk/unlurk. This should respond to any !lurk
or !unlurk
command, send an optional message to the chat, and add the user to a list of lurkers in the chat (sending appropriate notifications)
Return the redemption status as part of the channel point callback. Also invoke the callback after the status has updated
Rather than requiring people to find their channel ID before starting the overlay, fetch prior to connecting to the client or PubSub.
Also cache the channel ID and channel name in the secrets directory so that they can be re-loaded later without needing to fetch
Many commands will use an @ prefix for usernames to allow for completion. We need to ensure these are taken out. This is probably best done in the UserManager when fetching by user name so that it works everywhere
Implement the ability to register a reward and callback with the ChannelPointManager. This should store the rewards, which may be in an incomplete state, until they can be matched up with the rewards from the API.
Once rewards have been matched up any missing rewards should be created in the API
Authentication UI does not work by default because the UXML is not hooked up in Unity
Improve the setting up of feature managers, allowing feature managers to be created on the fly for internal user if the user hasn't created for their own use.
Also add the ability to fetch a feature manager of a type
Connections seem to be lost after unity re-compiles while running the project, fix it so they auto-reconnect
Keep a list of all people who have followed this stream. Persistence will be handled in a future issue
Keep a list of bits received this stream. Persistence will be handled in a future ticket.
It should show the same thing as no TwitchManager selected when nothing is selected at all
Keep a list of all channel points redeemed this stream. Persistence will be handled by a future issue
Keep a list of moderators currently in chat. This should forward OnModeratorJoined and OnModeratorLeft notifications from the Client
The authentication UI doesn't give any indication that saving was successful
Keep a list of active chatters in ViewersManager. This should call ChatterJoined() when a chatter that isn't already active sends a message. Chatters should be removed when OnUserLeft
is received
Rename ChatManager to ChatParticipantManager and rename ChatCommandManager to ChatMessageManager. Move chat message commands from former to latter
Keep a list of all subscribers who subscribed this stream. Persistence of this will happen in a later issue
Have RaidManager keep a list of all raids this stream. Persistence will be handled in a future issue
Add a button to the TwitchManager inspector to open the authentication UI.
Also investigate if there's a "bring to front" command in unity
At the moment the user has nowhere to really initialise parts of a feature manager besides overriding PubSub and Client initialisation. Create an Initialize method that can be overridden to do this setup
Is your feature request related to a problem? Please describe.
Active code requires user to code his way for each and every required feature. Hard to adopt and reuse coded features later. Every new feature requires reload.
Describe the solution you'd like
More decoupled agnostic approach allowing to have reusable "drag&dropable" element. Best scenario to have API/Framework loosely coupled with unity and twitch. Main core will be basic models and set of prebuild commands, validators and builders.
Describe alternatives you've considered
To rewrite active for more dynamic approach or start new independent repository/org.
Additional context
Below is approximate design. Not the greatest, but should help to illustrate the idea and easier navigate it.
Model act like database. With exposed interface they can be mapped to any storage. Regardless of platform (Twitch, Youtube, Discord etc.) users have common variables and can be stored , linked and monitored cross platform. Act as somewhat aggregator.
Provide set of adapters. Current one is for unity using TwitchAPI.Unity. Basically adapter/proxy class.
Adapter or adapters are injected to Managers (bad naming :( ) Managers provide active basic functionality of monitoring chat and platform events. Should be controlled by something Kernel like. Kernel will also sync and populate models using adapters.
Each manager accepts list of specific Interfaces. In unity should be ScriptableObjects. Every Object should have list of strategies knowing how to react on managers call when specific requirements are matched.
Example:
class CommandController (Manager). Has list of Commands that have Execute(data) method.
[CreateAssetMenu(fileName = "New Chat Command", menuName = "Twitchmata/Chat Command")]
public class ChatCommand : ScriptableObject
{
[SerializeField]
private string _command;
[SerializeField]
private string _description;
[SerializeField]
private Permissions _permissions;
[SerializeField]
private CommandStrategy[] _strategies;
public string Command => _command;
public string Description => _description;
// can be moved out and replaced by list of Validators
// following same principal as CommandStrategy
public Permissions Permissions => _permissions;
}
public abstract class CommandStrategy : ScriptableObject
{
public abstract void Execute(User user, Message message, Callable finished);
}
[CreateAssetMenu(fileName = "CommandStrategy", menuName = "Mata/Command")]
public class SendResponceStrategy : CommandStrategy
{
[SerializedField]
private string _template;
public override void Execute(User user, Message message, Callable finished)
{
Mata.SendMessage(_template);
}
}
This code allows to precreate all basic commands to be created and configured by clicking UI and drag&drop.
Same strategies later can easily be reused or be more specific like "Call my character ability".
Below are screenshots of same for Channel Point rewards.
Having code this way would also allow later to constantly increate amount of possible options and even exchange them between users (even runtime, between streamer interaction). Or have a portal, git with just a list of them as snippets.
In addition more users would be able to contribute to projects. Even regardless of the platform as having those components would allow easy adaptation via adapters.
And as extra benefit can allow cross platform user interaction (games, channel points etc.).
Hope this provides some perspective of what and how I see "endgame" of this tool.
Add a ManagedRewardGroup
type that holds a collection of rewards, allowing them to be enabled/disable en masse (also requires Enable/DisableRewardGroup()
methods
Keep a list of VIPs that are currently in chat. This should appear when the VIP joins and disappear when they leave calling the appropriate notification methods
When ChannelPointManager is initialised, get all rewards from the API. These should be stored in Reward objects that can be filled out with additional details and synced up with registered rewards later.
Create Utilities controller with method to fetch a user's avatar as a texture
Take API documentation + examples and format into a manual for users
Change TwitchManager to auto-detect feature managers either on the same game object or on a child game object
Double check all imports and remove any that aren't necessary/included
Add functionality to start raiding a channel. This involves multiple steps:
Add the ability to store stat info to disk and re-load when the overlay starts. Add options to either reset manually, on overlay start, or on stream start
Build a UI to walk users through getting their client ID, client secret, and authenticating their bot and broadcaster accounts, including selecting the appropriate permissions
Move subscriber list management from the TwitchManager to the SubscriberManager. This should fetch all subscribers on start and then update with any received subscribers
TwitchManager + all FeatureManagers should have a logging level (None, Error, Info). All calls should extensively log information if the logging level is set.
Look into adding a UI for invoking a debug command on a feature manager. This will probably be a separate window, but could be in an inspector. Should allow for customisation of debug inputs
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.