Skip to content

Commit db66898

Browse files
committed
docs: bring YouTube page up to date
Update the YouTube documentation page, as it is seriously outdated and thus inaccurate. List the supported URLs YAGPDB attempts to extract the channel from; add a separate header for the configuration options and explain how to edit an already existing feed. Detail the limit of 10 (250) active feeds and the behaviour when exceeding that limit. Explain the custom announcement message, listing additional context data available therein, as well as outline the "danger" that arises regarding role / everyone mentions when using it. Signed-off-by: Luca Zeuch <[email protected]>
1 parent ed25ac3 commit db66898

File tree

4 files changed

+109
-16
lines changed

4 files changed

+109
-16
lines changed
117 KB
Loading
24.9 KB
Loading

content/docs/notifications/youtube.md

Lines changed: 109 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,126 @@ description = "Subscribe to your favorite YouTubers without polluting your own f
66

77
Get notifications from your favorite YouTubers directly in your Discord server.
88

9-
<!--more-->
9+
{{< callout context="note" title="Note: Required Bot Permissions" icon="outline/info-circle" >}}
1010

11-
## YouTube Feed
11+
The bot requires at least the "Read Messages" and "Send Messages" permissions in the channel you want to post the feed
12+
in.
1213

13-
{{< callout context="danger" title="Danger" icon="outline/alert-octagon" >}}
14+
{{< /callout >}}
15+
16+
## Adding a YouTube Feed
17+
18+
To add a new feed simply copy the channel URL from YouTube and paste it into the "Link" field under "Add New Feed" (you
19+
may need to scroll down a bit); then select a channel to post it to. For a visual reference, please see the image below.
20+
21+
<center>
22+
23+
!["Link" field to add a new YouTube feed](./youtube-new-feed.png)
24+
25+
</center>
26+
27+
28+
If you are unable to obtain a direct channel URL, similar to<br>
29+
*https://youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw*, we also support the following URLs:
30+
31+
- Video links (https://youtube.com/watch?v=dQw4w9WgXcQ)
32+
- Shorts links (https://youtube.com/shorts/pBZ_2pX_8mg)
33+
- Share links (https://youtu.be/dQw4w9WgXcQ)
34+
- Live links (https://youtube.com/live/jfKfPfyJRdk)
35+
- Playlist links (https://youtube.com/playlist?list=PLEamUZtdyTMxwDNQ97Y7im8EwqRyht12R)
36+
37+
Although we make an attempt at extracting the channel from usernames (https://youtube.com/user/MontyPython),
38+
custom links (https://youtube.com/c/Taskmaster), and handles (https://youtube.com/@TomScottGo), these are not as
39+
reliable as the links listed above, as we use the first result of a YouTube search to determine the channel via these
40+
URLs.
41+
42+
If you find yourself having trouble adding a feed using these kinds of URLs, please try to use one of the links listed
43+
above before asking for help in the [support server](/discord).
44+
45+
{{< callout context="caution" title="Warning: Maximum Number of Feeds" icon="outline/info-circle" >}}
46+
47+
You cannot have more than 10 active YouTube feeds at a time (250 with [Premium](/docs/welcome/premium)). If you have
48+
that many feeds active, you cannot add more until you disable at least one of those. That disabled excess feed will be
49+
deleted once you add a new one.
50+
51+
{{< /callout >}}
1452

15-
Do **NOT** fill in both the Channel ID and the Channel URL.
53+
## Configuring a YouTube Feed
1654

17-
- There may be up to 5-15 minutes of delay for the bot to announce the video after it gets posted.
18-
- The bot will only announce the video if it's public.
55+
During setup of a feed there are four more options you can configure, namely:
56+
57+
- mention `@everyone` in the announcement message
58+
- mention a specific role
59+
- also publish livestreams
60+
- also publish shorts
61+
62+
{{< callout context="note" title="Note: Required Bot Permissions" icon="outline/info-circle" >}}
63+
64+
The bot needs mention `@everyone` or "mention this role" permissions if you wish to mention everyone or a specific role
65+
of your choosing.
1966

2067
{{< /callout >}}
2168

22-
![Showcase of the YouTube feed interface.](./youtube.png)
69+
You need not configure any of these ahead of time, you can always [edit the feed](#editing-a-youtube-feed) later.
70+
71+
## Editing a YouTube Feed
72+
73+
To edit a feed, scroll down further until you reach the "Current subscribed channels" section. There you will find a
74+
list of all the feeds you have added.
75+
76+
!["Current subscribed channels" section to edit a YouTube feed](./youtube-edit-feed.png)
77+
78+
Going from left to right of the editable options, you can change the following:
79+
80+
- The Discord channel to post to
81+
- Mention `@everyone` in the announcement message
82+
- Mention a specific role
83+
- Also publish livestreams
84+
- Also publish shorts
85+
- Disable the feed until you enable it again
2386

24-
To get notifications from a YouTube channel, simply go to the YouTuber's channel and input either the ID or the Username in their respective field of the followings:
87+
Once you have made your changes, click the "Save" button on the far right to save your changes. If you instead wish to
88+
delete the feed, click the "Delete" button just below the "Save" button. None of these options need to be equal across
89+
all your feeds, you can have different settings for each feed.
2590

26-
- YouTube Channel ID
91+
You can only save changes to a feed one at a time, so if there are multiple feeds you wish to edit, you have to do so
92+
separately, saving after each feed you edited.
2793

28-
- YouTube Channel Username
94+
## Custom Announcement
95+
96+
If you take a look at the top-right of the configuration page, you'll see a field for custom command templates for usage
97+
in the announcement message provided for YouTube feeds. The default response is the following code:
98+
99+
```yag
100+
{{.ChannelName}} published a new video! {{.URL}}
101+
```
102+
103+
You can customize this message to your liking, but bear in mind that using a custom announcement message will override
104+
the default announcement's mention settings *for all channels*, therefore you will have to implement this logic by
105+
yourself. Refer to the [mentions functions](https://help.yagpdb.xyz/docs/reference/templates/functions/#mentions) for
106+
more information.
107+
108+
{{< callout context="danger" title="Danger: Custom Announcement Overrides Settings" icon="outline/alert-octagon" >}}
109+
110+
Using a custom announcement message will override the default announcement's mention settings for all channels. Really.
111+
112+
{{< /callout >}}
29113

30-
If your channel looks like this `youtube.com/user/h3h3Productions` then you would go into the username line and type
31-
in h3h3Productions.
114+
### Additional Context Data
32115

33-
If your channel looks like this `youtube.com/channel/UCt-ERbX-2yA6cAqfdKOlUwQ` then you would go into the ID line and
34-
type in UCt-ERbX-2yA6cAqfdKOlUwQ.
116+
In addition to the standard context data available to all custom commands, we provide the following additional context
117+
data:
35118

36-
You can change the channel that the notifications are posted to via the dropdown menu.
119+
- `{{ .ChannelID }}`: ID of the YouTube Channel.
120+
- `{{ .ChannelName }}`: Name of the YouTube Channel.
121+
- `{{ .IsLiveStream }}`: True, if the notification is for a livestream else False.
122+
- `{{ .IsUpcoming }}`: True, if the notification is for a scheduled release else False.
123+
- `{{ .VideoID }}`: ID of the video.
124+
- `{{ .VideoTitle }}`: Title of the video.
125+
- `{{ .VideoThumbnail }}`: Thumbnail image URL of the video.
126+
- `{{ .VideoDescription }}`: Description of the video.
127+
- `{{ .VideoDurationSeconds }}`: Duration of video in seconds.
128+
- `{{ .Video }}`: Data of the video as available in the [YouTube API][video-yt-api].
129+
- `{{ .URL }}`: Video URL.
37130

38-
You can also mention everyone by clicking the checkbox under the dropdown menu that says Mention everyone.
131+
[video-yt-api]: https://pkg.go.dev/google.golang.org/api/youtube/v3#Video
-53.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)