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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user