Skip to content

Version 0.56

Nathan edited this page Jul 7, 2021 · 13 revisions

Jump to New Features

  • Fix for IsSourceVisible not returning a value (woops)
  • Twitch emote urls have been updated to new cdn, so animated emotes will show if used
  • Fix not being able to delete a file in file watcher
  • Handle a potential error in audio playback (from malformed audio, or wrong audio types)
  • OBS Set Source Visibility has been changed to a state, and will auto update settings
  • SLOBS Set Source Visibility has been changed to a state, and will auto update settings
  • Twitch Message sub-actions will now show part of the message to be sent in the sub action list
  • Add new capability to get your clips, this functionality is reserved for Execute C# at the moment, and a basic example will be provided
  • Misc fixes/updates

New Features

Twitch Clips

You can now retrieve a list of your Twitch clips, and do with them as you wish. Make a !randomclip command, that'll get your clips and output to chat a random clip, or by way of some HTML magic, have it play in OBS.

There are 2 new methods available for the Execute C# Code sub-action

List<ClipData> GetAllClips();
List<ClipData> GetClipsForGame(int gameId);
List<ClipData> GetClipsForUser(int userId);
List<ClipData> GetClipsForUser(string username);

Example Execute C# Code:

using System;
using System.Linq;

public class CPHInline
{
	public bool Execute()
	{
		// get all clips from twitch, can also get by Game ID
		var allClips = CPH.GetAllClips();

		// if no clips, stop processing anymore actions
		if (allClips.Count == 0) return false;

		// pick a random clip
		var randomClip = allClips.OrderBy(c => Guid.NewGuid()).First();

		// send a message to chat with the random clip
		CPH.SendMessage($"Random Clip! {randomClip.Title}");
		CPH.SendMessage($"{randomClip.Url}");

		// set some data in the arguments, for any subaction to use
		CPH.SetArgument("randomClipTitle", randomClip.Title);
		CPH.SetArgument("randomClipUrl", randomClip.Url);
		CPH.SetArgument("randomClipDuration", randomClip.Duration);
		CPH.SetArgument("randomClipUser", randomClip.CreatorName);
		CPH.SetArgument("randomClipViewCount", randomClip.ViewCount);
		CPH.SetArgument("randomClipThumbnailUrl", randomClip.ThumbnailUrl);

		return true;
	}
}

Clone this wiki locally