Skip to content
This repository has been archived by the owner on May 4, 2024. It is now read-only.

Y2DL v2.0.0-b1 #2

Merged
merged 18 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
/.idea/.idea.SubscriberWebhook/.idea/shelf/Uncommitted_changes_before_Update_at_20_07_2023_1_31_pm_[Changes]/shelved.patch
/.idea/.idea.SubscriberWebhook/.idea/shelf/Uncommitted_changes_before_rebase__Changes_.xml
/.idea/.idea.SubscriberWebhook/.idea/shelf/Uncommitted_changes_before_Update_at_20_07_2023_1_31_pm__Changes_.xml
/bin/
/.idea/
/obj/
133 changes: 133 additions & 0 deletions Config/Y2DLConfig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# YouTube2DiscordLink (formerly YTSCTD) 2.0.0
# Config File
# For smooth operation, follow the instructions at https://jbcarreon123.github.io/docs/y2dl

# DO NOT TOUCH THIS!
Version: 2.0.0-b1

Main:
# Webhook or Bot
Type: Bot

# If bot, configure this.
# If not, don't touch this.
BotConfig:
BotToken: [YOUR BOT TOKEN HERE]
State: DoNotDisturb
Status:
Enabled: true
Emoji: 🔗
Text: jbcarreon123.github.io/y2dl

WebhookConfig:
Name: Y2DL Relay Webhook
AvatarUrl: https://jbcarreon123.github.io/Y2DL.png

# The update interval (in milliseconds)
UpdateInterval: 60000

# Required at least 1 so it can get the info.
ApiKeys:
- YoutubeApiKey: [YOUR API KEY HERE]
YoutubeApiName: [YOUR API NAME HERE]

# Defines the log severity to shown in the console.
Logging:
LogLevel: Verbose
LogErrorChannel:
UseWebhook: false
WebhookUrl: ""
GuildId: 0
ChannelId: 0

Services:
DynamicChannelInfo:
Enabled: false
# Supports the full Discord Markdown (for Bots/Webhooks).
# {channel} for Channel Name, and {channelUrl} for channel's URL
# {lVidName} for latest video's title, {lVidThumbnail} for it's thumbnail,
# and {lVidUrl} for it's URL
Messages:
- ChannelId: [CHANNEL ID HERE]
Output:
# If you want to use a webhook instead of a bot, without using Webhook mode, set this to true.
# Note: Only used in Bot mode. If in Webhook mode, it is ignored because you already using a webhook.
UseWebhook: false
# Only used in Webhook mode, or if you set UseWebhook to true.
WebhookUrl: [YOUR DISCORD WEBHOOK URL]
# Used in both
ChannelId: 0
# The thing below is only used in Bot mode.
GuildId: 0

Embed:
Title: "{Name} ({Handle})"
TitleUrl: "{ChannelUrl}"
Description: |
{Description}
Subscribers: **{Statistics.Subscribers}**
Color: "#552233"
ImageUrl: "{LatestVideo.Thumbnail}"
ThumbnailUrl: "{ChannelAvatarUrl}"
Fields:
- Name: "Latest video"
Value: |
[{LatestVideo.Title}]({LatestVideo.Url})
Views: {LatestVideo.Statistics.Views}
Likes: {LatestVideo.Statistics.Likes}
Comments: {LatestVideo.Statistics.Comments}

ChannelReleases:
Enabled: true
# Supports the full Discord Markdown (for Bots/Webhooks).
# {channel} for Channel Name, and {channelUrl} for channel's URL
# {lVidName} for latest video's title, {lVidThumbnail} for it's thumbnail,
# and {lVidUrl} for it's URL
# Go to https://jbcarreon123.github.io/docs/y2dl/message for more variables.
Messages:
- ChannelId: [CHANNEL ID HERE]
Output:
# If you want to use a webhook instead of a bot, without using Webhook mode, set this to true.
UseWebhook: false
# Only used in Webhook mode, or if you set UseWebhook to true.
WebhookUrl: [YOUR DISCORD WEBHOOK URL]
# Used in both
ChannelId: 0
# The 2 things below is only used in Bot mode.
GuildId: 0
Content: "@everyone"
Embed:
Author: "New video on {Name} is just released!"
Title: "{LatestVideo.Title}"
TitleUrl: "{LatestVideo.Url}"
Description: "{LatestVideo.Description}"
Color: "#252525"
ImageUrl: "{LatestVideo.Thumbnail}"

# Only works if Type is Bot. Else, it will be ignored.
DynamicChannelInfoForVoiceChannels:
Enabled: true
# {channel} for Channel Name, and {channelSubscribers} for subscibers.
# Go to https://jbcarreon123.github.io/docs/y2dl/voicechannels for more variables.
Channels:
- ChannelId: [CHANNEL ID HERE]
VoiceChannels:
- GuildId: 0
ChannelId: 0
Name: "Subscribers: {Statistics.FormattedSubscribers}"

# Only works if Type is Bot. Else, it will be ignored.
Commands:
Enabled: true
# Available types: SlashCommand, Prefix, or Both.
Type: Both
# Only used if Type is Prefix or Both.
Prefix: "!"
About:
Enabled: true
Embed:
Author: "{Name}"
AuthorAvatarUrl: "{AvatarUrl}"
Fields:
- Name: "Just a bot."
Value: "Yeah."
Binary file removed Images/BasicModeExample.png
Binary file not shown.
Binary file removed Images/SimpleModeExample.png
Binary file not shown.
Binary file removed Images/VerboseModeExample.png
Binary file not shown.
Binary file removed Images/VerboseModeExample2.png
Binary file not shown.
Binary file added Images/y2dl-flat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions Models/BotInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Discord.WebSocket;

namespace Y2DL.Models;

public class BotInfo
{
public string Name = Program.GetCurrentUser().Username;
public string AvatarUrl = Program.GetCurrentUser().GetAvatarUrl();
public ulong UserId = Program.GetCurrentUser().Id;

public ulong GuildId { get; set; }
public string GuildName { get; set; }
}
Loading