mirror of
https://github.com/Luzifer/discord-community.git
synced 2024-12-29 23:01:18 +00:00
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:
parent
c08bacbecf
commit
908d8fd969
2 changed files with 5 additions and 5 deletions
|
@ -48,7 +48,7 @@ func (m *modStreamSchedule) Initialize(id string, crontab *cron.Cron, discord *d
|
||||||
"embed_title",
|
"embed_title",
|
||||||
"twitch_channel_id",
|
"twitch_channel_id",
|
||||||
"twitch_client_id",
|
"twitch_client_id",
|
||||||
"twitch_token",
|
"twitch_client_secret",
|
||||||
); err != nil {
|
); err != nil {
|
||||||
return errors.Wrap(err, "validating attributes")
|
return errors.Wrap(err, "validating attributes")
|
||||||
}
|
}
|
||||||
|
@ -68,9 +68,9 @@ func (m modStreamSchedule) cronUpdateSchedule() {
|
||||||
twitch := newTwitchAdapter(
|
twitch := newTwitchAdapter(
|
||||||
// @attr twitch_client_id required string "" Twitch client ID the token was issued for
|
// @attr twitch_client_id required string "" Twitch client ID the token was issued for
|
||||||
m.attrs.MustString("twitch_client_id", nil),
|
m.attrs.MustString("twitch_client_id", nil),
|
||||||
"", // No Client Secret used
|
// @attr twitch_client_secret required string "" Secret for the Twitch app identified with twitch_client_id
|
||||||
// @attr twitch_token required string "" Token for the user the `twitch_channel_id` belongs to
|
m.attrs.MustString("twitch_client_secret", nil),
|
||||||
m.attrs.MustString("twitch_token", nil),
|
"", // No User-Token used
|
||||||
)
|
)
|
||||||
|
|
||||||
data, err := twitch.GetChannelStreamSchedule(
|
data, err := twitch.GetChannelStreamSchedule(
|
||||||
|
|
|
@ -134,7 +134,7 @@ Posts stream schedule derived from Twitch schedule as embed in Discord channel
|
||||||
| `embed_title` | ✅ | string | | Title of the embed |
|
| `embed_title` | ✅ | string | | Title of the embed |
|
||||||
| `twitch_channel_id` | ✅ | string | | ID (not name) of the channel to fetch the schedule from |
|
| `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_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 |
|
| `cron` | | string | `*/10 * * * *` | When to execute the schedule transfer |
|
||||||
| `embed_color` | | int64 | `0x2ECC71` | Integer / HEX representation of the color for the embed |
|
| `embed_color` | | int64 | `0x2ECC71` | Integer / HEX representation of the color for the embed |
|
||||||
| `embed_description` | | string | | Description for the embed block |
|
| `embed_description` | | string | | Description for the embed block |
|
||||||
|
|
Loading…
Reference in a new issue