Implement /marker command (#2360)

This command works the same as it does on Twitch web chat - it creates a streamer marker at the current timestamp with an optional description
This commit is contained in:
Paweł
2021-01-30 15:39:01 +01:00
committed by GitHub
parent eda5e2b504
commit 278a00a700
5 changed files with 172 additions and 3 deletions
+27
View File
@@ -165,12 +165,33 @@ struct HelixChannel {
}
};
struct HelixStreamMarker {
QString createdAt;
QString description;
QString id;
int positionSeconds;
explicit HelixStreamMarker(QJsonObject jsonObject)
: createdAt(jsonObject.value("created_at").toString())
, description(jsonObject.value("description").toString())
, id(jsonObject.value("id").toString())
, positionSeconds(jsonObject.value("position_seconds").toInt())
{
}
};
enum class HelixClipError {
Unknown,
ClipsDisabled,
UserNotAuthenticated,
};
enum class HelixStreamMarkerError {
Unknown,
UserNotAuthorized,
UserNotAuthenticated,
};
class Helix final : boost::noncopyable
{
public:
@@ -242,6 +263,12 @@ public:
ResultCallback<HelixChannel> successCallback,
HelixFailureCallback failureCallback);
// https://dev.twitch.tv/docs/api/reference/#create-stream-marker
void createStreamMarker(
QString broadcasterId, QString description,
ResultCallback<HelixStreamMarker> successCallback,
std::function<void(HelixStreamMarkerError)> failureCallback);
void update(QString clientId, QString oauthToken);
static void initialize();