mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 20:01:17 +00:00
[docs] Add field-type annotations to events
closes #57 Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
7737d939f4
commit
8c2c4e7c62
1 changed files with 99 additions and 98 deletions
|
@ -8,10 +8,10 @@ Ad-break has begun and ads are playing now in mentioned channel.
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `duration` - Duration of the ads in seconds
|
- `duration` _int64_ - Duration of the ads in seconds
|
||||||
- `is_automatic` - Were the ads started by the ad-manager?
|
- `is_automatic` _bool_ - Were the ads started by the ad-manager?
|
||||||
- `started_at` - When did the ad-break start
|
- `started_at` _time.Time_ - When did the ad-break start
|
||||||
|
|
||||||
## `ban`
|
## `ban`
|
||||||
|
|
||||||
|
@ -21,9 +21,9 @@ Note: This event does **not** contain the acting user! You cannot use the `{{.us
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `target_id` - The ID of the user being banned
|
- `target_id` _string_ - The ID of the user being banned
|
||||||
- `target_name` - The login-name of the user being banned
|
- `target_name` _string_ - The login-name of the user being banned
|
||||||
|
|
||||||
## `bits`
|
## `bits`
|
||||||
|
|
||||||
|
@ -31,9 +31,9 @@ User spent bits in the channel. The full message is available like in a normal c
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `bits` - Total amount of bits spent in the message
|
- `bits` _int64_ - Total amount of bits spent in the message
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `username` - The login-name of the user who spent the bits
|
- `username` _string_ - The login-name of the user who spent the bits
|
||||||
|
|
||||||
## `category_update`
|
## `category_update`
|
||||||
|
|
||||||
|
@ -41,8 +41,8 @@ The current category for the channel was changed. (This event has some delay to
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `category` - The name of the new game / category
|
- `category` _string_ - The name of the new game / category
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
|
|
||||||
## `channelpoint_redeem`
|
## `channelpoint_redeem`
|
||||||
|
|
||||||
|
@ -50,14 +50,14 @@ A custom channel-point reward was redeemed in the given channel. (Only available
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `reward_cost` - Number of points the user paid for the reward
|
- `reward_cost` _int64_ - Number of points the user paid for the reward
|
||||||
- `reward_id` - ID of the reward the user redeemed
|
- `reward_id` _string_ - ID of the reward the user redeemed
|
||||||
- `reward_title` - Title of the reward the user redeemed
|
- `reward_title` _string_ - Title of the reward the user redeemed
|
||||||
- `status` - Status of the reward (one of `unknown`, `unfulfilled`, `fulfilled`, and `canceled`)
|
- `status` _string_ - Status of the reward (one of `unknown`, `unfulfilled`, `fulfilled`, and `canceled`)
|
||||||
- `user_id` - The ID of the user who redeemed the reward
|
- `user_id` _string_ - The ID of the user who redeemed the reward
|
||||||
- `user_input` - The text the user entered into the input for the reward
|
- `user_input` _string_ - The text the user entered into the input for the reward
|
||||||
- `user` - The login-name of the user who redeemed the reward
|
- `user` _string_ - The login-name of the user who redeemed the reward
|
||||||
|
|
||||||
## `clearchat`
|
## `clearchat`
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ Note: This event does **not** contain the acting user! You cannot use the `{{.us
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
|
|
||||||
## `delete`
|
## `delete`
|
||||||
|
|
||||||
|
@ -77,9 +77,9 @@ Note: This event does **not** contain the acting user! You cannot use the `{{.us
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `message_id` - The UUID of the message being deleted
|
- `message_id` _string_ - The UUID of the message being deleted
|
||||||
- `target_name` - Login name of the author of the deleted message
|
- `target_name` _string_ - Login name of the author of the deleted message
|
||||||
|
|
||||||
## `follow`
|
## `follow`
|
||||||
|
|
||||||
|
@ -87,10 +87,10 @@ User followed the channel. This event is not de-duplicated and therefore might b
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `followed_at` - Time object of the follow date
|
- `followed_at` _time.Time_ - Time object of the follow date
|
||||||
- `user_id` - ID of the newly following user
|
- `user_id` _string_ - ID of the newly following user
|
||||||
- `user` - The login-name of the user who followed
|
- `user` _string_ - The login-name of the user who followed
|
||||||
|
|
||||||
## `giftpaidupgrade`
|
## `giftpaidupgrade`
|
||||||
|
|
||||||
|
@ -98,9 +98,9 @@ User upgraded their gifted subscription into a paid one. This event does not con
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `gifter` - The login-name of the user who gifted the subscription
|
- `gifter` _string_ - The login-name of the user who gifted the subscription
|
||||||
- `username` - The login-name of the user who upgraded their subscription
|
- `username` _string_ - The login-name of the user who upgraded their subscription
|
||||||
|
|
||||||
## `hypetrain_begin`, `hypetrain_end`, `hypetrain_progress`
|
## `hypetrain_begin`, `hypetrain_end`, `hypetrain_progress`
|
||||||
|
|
||||||
|
@ -108,10 +108,10 @@ An Hype-Train has begun, ended or progressed in the given channel.
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `level` - The current level of the Hype-Train
|
- `level` _int64_ - The current level of the Hype-Train
|
||||||
- `levelProgress` - Percentage of reached "points" in the current level to complete the level (not available on `hypetrain_end`)
|
- `levelProgress` _float64_ - Percentage of reached "points" in the current level to complete the level (not available on `hypetrain_end`)
|
||||||
- `event` - Raw Hype-Train event, see schema in [`pkg/twitch/eventsub.go#L92`](https://github.com/Luzifer/twitch-bot/blob/master/pkg/twitch/eventsub.go#L121)
|
- `event` _EventSubEventHypetrain_ - Raw Hype-Train event, see schema in [`pkg/twitch/eventsub.go#L92`](https://github.com/Luzifer/twitch-bot/blob/master/pkg/twitch/eventsub.go#L121)
|
||||||
|
|
||||||
## `join`
|
## `join`
|
||||||
|
|
||||||
|
@ -119,8 +119,8 @@ User joined the channel-chat. This is **NOT** an indicator they are viewing, the
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `user` - The login-name of the user who joined
|
- `user` _string_ - The login-name of the user who joined
|
||||||
|
|
||||||
## `kofi_donation`
|
## `kofi_donation`
|
||||||
|
|
||||||
|
@ -128,14 +128,14 @@ A Ko-fi donation was received through the API-Webhook.
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred for
|
- `channel` _string_ - The channel the event occurred for
|
||||||
- `from` - The name submitted by Ko-fi (can be arbitrarily entered)
|
- `from` _string_ - The name submitted by Ko-fi (can be arbitrarily entered)
|
||||||
- `amount` - The amount donated as submitted by Ko-fi (i.e. 27.95)
|
- `amount` _float64_ - The amount donated as submitted by Ko-fi (i.e. 27.95)
|
||||||
- `currency` - The currency of the amount (i.e. USD)
|
- `currency` _string_ - The currency of the amount (i.e. USD)
|
||||||
- `isSubscription` - Boolean, true on monthly subscriptions, false on single-donations
|
- `isSubscription` _bool_ - true on monthly subscriptions, false on single-donations
|
||||||
- `isFirstSubPayment` - Boolean, true on first montly payment, false otherwise
|
- `isFirstSubPayment` _bool_ - true on first montly payment, false otherwise
|
||||||
- `message` - The message entered by the donator (**not** present when donation was marked as private!)
|
- `message` _string_ - The message entered by the donator (**not** present when donation was marked as private!)
|
||||||
- `tier` - The tier the subscriber subscribed to (seems not to be filled on the first transaction?)
|
- `tier` _string_ - The tier the subscriber subscribed to (seems not to be filled on the first transaction?)
|
||||||
|
|
||||||
## `outbound_raid`
|
## `outbound_raid`
|
||||||
|
|
||||||
|
@ -143,10 +143,10 @@ The channel has raided another channel. (The event is issued in the moment the r
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the raid originated at
|
- `channel` _string_ - The channel the raid originated at
|
||||||
- `to` - The login-name of the channel the viewers are sent to
|
- `to` _string_ - The login-name of the channel the viewers are sent to
|
||||||
- `to_id` - The ID of the channel the viewers are sent to
|
- `to_id` _string_ - The ID of the channel the viewers are sent to
|
||||||
- `viewers` - The number of viewers included in the raid
|
- `viewers` _int64_ - The number of viewers included in the raid
|
||||||
|
|
||||||
## `part`
|
## `part`
|
||||||
|
|
||||||
|
@ -154,8 +154,8 @@ User left the channel-chat. This is **NOT** an indicator they are no longer view
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `user` - The login-name of the user who left
|
- `user` _string_ - The login-name of the user who left
|
||||||
|
|
||||||
## `permit`
|
## `permit`
|
||||||
|
|
||||||
|
@ -163,9 +163,9 @@ User received a permit, which means they are no longer affected by rules which a
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `user` - The login-name of the user who **gave** the permit
|
- `user` _string_ - The login-name of the user who **gave** the permit
|
||||||
- `to` - The username who got the permit
|
- `to` _string_ - The username who got the permit
|
||||||
|
|
||||||
## `poll_begin` / `poll_end` / `poll_progress`
|
## `poll_begin` / `poll_end` / `poll_progress`
|
||||||
|
|
||||||
|
@ -173,10 +173,10 @@ A poll was started / was ended / had changes in the given channel.
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `poll` - The poll object describing the poll, see schema in [`pkg/twitch/eventsub.go#L92`](https://github.com/Luzifer/twitch-bot/blob/master/pkg/twitch/eventsub.go#L152)
|
- `poll` _EventSubEventPoll_ - The poll object describing the poll, see schema in [`pkg/twitch/eventsub.go#L92`](https://github.com/Luzifer/twitch-bot/blob/master/pkg/twitch/eventsub.go#L152)
|
||||||
- `status` - The status of the poll (one of `completed`, `terminated` or `archived`) - only available in `poll_end`
|
- `status` _string_ - The status of the poll (one of `completed`, `terminated` or `archived`) - only available in `poll_end`
|
||||||
- `title` - The title of the poll the event was generated for
|
- `title` _string_ - The title of the poll the event was generated for
|
||||||
|
|
||||||
## `raid`
|
## `raid`
|
||||||
|
|
||||||
|
@ -184,9 +184,9 @@ The channel was raided by another user.
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `username` - The login-name of the user who raided the channel
|
- `username` _string_ - The login-name of the user who raided the channel
|
||||||
- `viewercount` - The amount of users who have been raided (this number is not fully accurate)
|
- `viewercount` _int64_ - The amount of users who have been raided (this number is not fully accurate)
|
||||||
|
|
||||||
## `resub`
|
## `resub`
|
||||||
|
|
||||||
|
@ -194,10 +194,10 @@ The user shared their resubscription. (This event is triggered manually by the u
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `plan` - The sub-plan they are using (`1000` = T1, `2000` = T2, `3000` = T3, `Prime`)
|
- `plan` _string_ - The sub-plan they are using (`1000` = T1, `2000` = T2, `3000` = T3, `Prime`)
|
||||||
- `subscribed_months` - How long have they been subscribed
|
- `subscribed_months` _int64_ - How long have they been subscribed
|
||||||
- `username` - The login-name of the user who resubscribed
|
- `username` _string_ - The login-name of the user who resubscribed
|
||||||
|
|
||||||
## `shoutout_created`
|
## `shoutout_created`
|
||||||
|
|
||||||
|
@ -205,10 +205,10 @@ The channel gave another streamer a (Twitch native) shoutout
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `to_id` - The ID of the channel who received the shoutout
|
- `to_id` _string_ - The ID of the channel who received the shoutout
|
||||||
- `to` - The login-name of the channel who received the shoutout
|
- `to` _string_ - The login-name of the channel who received the shoutout
|
||||||
- `viewers` - The amount of viewers the shoutout was shown to
|
- `viewers` _int64_ - The amount of viewers the shoutout was shown to
|
||||||
|
|
||||||
## `shoutout_received`
|
## `shoutout_received`
|
||||||
|
|
||||||
|
@ -216,10 +216,10 @@ The channel received a (Twitch native) shoutout by another channel.
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `from_id` - The ID of the channel who issued the shoutout
|
- `from_id` _string_ - The ID of the channel who issued the shoutout
|
||||||
- `from` - The login-name of the channel who issued the shoutout
|
- `from` _string_ - The login-name of the channel who issued the shoutout
|
||||||
- `viewers` - The amount of viewers the shoutout was shown to
|
- `viewers` _int64_ - The amount of viewers the shoutout was shown to
|
||||||
|
|
||||||
## `stream_offline`
|
## `stream_offline`
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ The channels stream went offline. (This event has some delay to the real categor
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
|
|
||||||
## `stream_online`
|
## `stream_online`
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ The channels stream went offline. (This event has some delay to the real categor
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
|
|
||||||
## `sub`
|
## `sub`
|
||||||
|
|
||||||
|
@ -243,9 +243,9 @@ The user newly subscribed on their own. (This event is triggered automatically a
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `plan` - The sub-plan they are using (`1000` = T1, `2000` = T2, `3000` = T3, `Prime`)
|
- `plan` _string_ - The sub-plan they are using (`1000` = T1, `2000` = T2, `3000` = T3, `Prime`)
|
||||||
- `username` - The login-name of the user who subscribed
|
- `username` _string_ - The login-name of the user who subscribed
|
||||||
|
|
||||||
## `subgift`
|
## `subgift`
|
||||||
|
|
||||||
|
@ -253,13 +253,14 @@ The user gifted the subscription to a specific user. (This event **DOES** occur
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `gifted_months` - Number of months the user gifted
|
- `gifted_months` _int64_ - Number of months the user gifted
|
||||||
- `origin_id` - ID unique to the gift-event (can be used to match `subgift` events to corresponding `submysterygift` event)
|
- `origin_id` _string_ - ID unique to the gift-event (can be used to match `subgift` events to corresponding `submysterygift` event)
|
||||||
- `plan` - The sub-plan they are using (`1000` = T1, `2000` = T2, `3000` = T3, `Prime`)
|
- `plan` _string_ - The sub-plan they are using (`1000` = T1, `2000` = T2, `3000` = T3, `Prime`)
|
||||||
- `subscribed_months` - How long the recipient has been subscribed
|
- `subscribed_months` _int64_ - How long the recipient has been subscribed
|
||||||
- `to` - The user who received the sub
|
- `to` _string_ - The user who received the sub
|
||||||
- `username` - The login-name of the user who gifted the subscription
|
- `total_gifted` _int64_ - How many subs has the user given in total (might be zero due to users preferences)
|
||||||
|
- `username` _string_ - The login-name of the user who gifted the subscription
|
||||||
|
|
||||||
## `submysterygift`
|
## `submysterygift`
|
||||||
|
|
||||||
|
@ -267,11 +268,11 @@ The user gifted multiple subs to the community. (This event is followed by `numb
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `number` - The amount of gifted subs
|
- `number` _int64_ - The amount of gifted subs
|
||||||
- `origin_id` - ID unique to the gift-event (can be used to match `subgift` events to corresponding `submysterygift` event)
|
- `origin_id` _string_ - ID unique to the gift-event (can be used to match `subgift` events to corresponding `submysterygift` event)
|
||||||
- `plan` - The sub-plan they are using (`1000` = T1, `2000` = T2, `3000` = T3, `Prime`)
|
- `plan` _string_ - The sub-plan they are using (`1000` = T1, `2000` = T2, `3000` = T3, `Prime`)
|
||||||
- `username` - The login-name of the user who gifted the subscription
|
- `username` _string_ - The login-name of the user who gifted the subscription
|
||||||
|
|
||||||
## `sus_user_message`
|
## `sus_user_message`
|
||||||
|
|
||||||
|
@ -304,11 +305,11 @@ Note: This event does **not** contain the acting user! You cannot use the `{{.us
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `duration` - The timeout duration (`time.Duration`, nanoseconds)
|
- `duration` _time.Duration_ - The timeout duration (nanoseconds)
|
||||||
- `seconds` - The timeout duration (`int`, seconds)
|
- `seconds` _int_ - The timeout duration (seconds)
|
||||||
- `target_id` - The ID of the user being timed out
|
- `target_id` _string_ - The ID of the user being timed out
|
||||||
- `target_name` - The login-name of the user being timed out
|
- `target_name` _string_ - The login-name of the user being timed out
|
||||||
|
|
||||||
## `title_update`
|
## `title_update`
|
||||||
|
|
||||||
|
@ -316,8 +317,8 @@ The current title for the channel was changed. (This event has some delay to the
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` _string_ - The channel the event occurred in
|
||||||
- `title` - The title of the stream
|
- `title` _string_ - The title of the stream
|
||||||
|
|
||||||
## `whisper`
|
## `whisper`
|
||||||
|
|
||||||
|
@ -325,4 +326,4 @@ The bot received a whisper message. (You can use `(.*)` as message match and `{{
|
||||||
|
|
||||||
Fields:
|
Fields:
|
||||||
|
|
||||||
- `username` - The login-name of the user who sent the message
|
- `username` _string_ - The login-name of the user who sent the message
|
||||||
|
|
Loading…
Reference in a new issue