Sec: Use app-access-token instead of user-token for schedule fetching

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-08-21 01:25:19 +02:00
parent c08bacbecf
commit 908d8fd969
Signed by: luzifer
GPG Key ID: 0066F03ED215AD7D
2 changed files with 5 additions and 5 deletions

View File

@ -48,7 +48,7 @@ func (m *modStreamSchedule) Initialize(id string, crontab *cron.Cron, discord *d
"embed_title",
"twitch_channel_id",
"twitch_client_id",
"twitch_token",
"twitch_client_secret",
); err != nil {
return errors.Wrap(err, "validating attributes")
}
@ -68,9 +68,9 @@ func (m modStreamSchedule) cronUpdateSchedule() {
twitch := newTwitchAdapter(
// @attr twitch_client_id required string "" Twitch client ID the token was issued for
m.attrs.MustString("twitch_client_id", nil),
"", // No Client Secret used
// @attr twitch_token required string "" Token for the user the `twitch_channel_id` belongs to
m.attrs.MustString("twitch_token", nil),
// @attr twitch_client_secret required string "" Secret for the Twitch app identified with twitch_client_id
m.attrs.MustString("twitch_client_secret", nil),
"", // No User-Token used
)
data, err := twitch.GetChannelStreamSchedule(

View File

@ -134,7 +134,7 @@ Posts stream schedule derived from Twitch schedule as embed in Discord channel
| `embed_title` | ✅ | string | | Title of the embed |
| `twitch_channel_id` | ✅ | string | | ID (not name) of the channel to fetch the schedule from |
| `twitch_client_id` | ✅ | string | | Twitch client ID the token was issued for |
| `twitch_token` | ✅ | string | | Token for the user the `twitch_channel_id` belongs to |
| `twitch_client_secret` | ✅ | string | | Secret for the Twitch app identified with twitch_client_id |
| `cron` | | string | `*/10 * * * *` | When to execute the schedule transfer |
| `embed_color` | | int64 | `0x2ECC71` | Integer / HEX representation of the color for the embed |
| `embed_description` | | string | | Description for the embed block |