-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from dorasto/oauth
Oauth
- Loading branch information
Showing
7 changed files
with
572 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { | ||
ChatInputCommandInteraction, | ||
PermissionsBitField, | ||
SlashCommandBuilder, | ||
EmbedBuilder, | ||
ButtonBuilder, | ||
ButtonStyle, | ||
} from "discord.js"; | ||
|
||
export default { | ||
data: new SlashCommandBuilder() | ||
.setName("authenticate") | ||
.setDescription("Connect your Doras account") | ||
.setDefaultMemberPermissions(PermissionsBitField.Flags.Administrator), | ||
cooldown: 3, | ||
async execute(inter: ChatInputCommandInteraction) { | ||
try { | ||
await inter.deferReply({ | ||
ephemeral: true, | ||
}); | ||
|
||
if (!inter.guildId) { | ||
await inter.editReply({ | ||
content: "This command can only be used in a server.", | ||
}); | ||
return; | ||
} | ||
|
||
// Authentication Link | ||
const authUrl = process.env.SERVER_URL + "/auth/login"; | ||
|
||
// Create Embed | ||
const embed = new EmbedBuilder() | ||
.setTitle("Authenticate") | ||
.setDescription( | ||
"Click the button below to authenticate your Doras account." | ||
); | ||
|
||
// Create Button | ||
const authButton = new ButtonBuilder() | ||
.setLabel("Connect Your Account") | ||
.setURL(authUrl) | ||
.setStyle(ButtonStyle.Link); // ButtonStyle.Link makes it a clickable link | ||
|
||
// Send Embed and Button | ||
await inter.editReply({ | ||
embeds: [embed], | ||
// components: [ | ||
// { | ||
// type: 1, // Action Row | ||
// components: [authButton], | ||
// }, | ||
// ], | ||
}); | ||
return; | ||
} catch (error) { | ||
console.error("Error executing authenticate command:", error); | ||
await inter.editReply({ | ||
content: "There was an error executing the command.", | ||
}); | ||
} | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" class="dark"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta name="description" | ||
content="Welcome to the Doras.to Discord Bot - Integrate Twitch Live, YouTube Live, YouTube Latest, and YouTube Shorts Latest directly into your Discord server with embeds." /> | ||
<meta name="keywords" | ||
content="discord bot, Doras.to Discord Bot, Twitch Live, YouTube Live, YouTube Latest, YouTube Shorts, Discord embeds, link shortening, analytics" /> | ||
<meta name="author" content="doras.to" /> | ||
<meta name="robots" content="index, follow" /> | ||
|
||
<!-- Open Graph meta tags for social media --> | ||
<meta property="og:title" content="Welcome to the Doras.to Discord Bot" /> | ||
<meta property="og:description" | ||
content="Integrate Twitch Live, YouTube Live, YouTube Latest, and YouTube Shorts Latest directly into your Discord server with Doras.to's embeds." /> | ||
<meta property="og:image" content="/favicon.ico" /> | ||
<meta property="og:url" content="https://discord.doras.to" /> | ||
<meta property="og:type" content="website" /> | ||
|
||
<!-- Twitter meta tags for Twitter Cards --> | ||
<meta name="twitter:title" content="Welcome to the Doras.to Discord Bot" /> | ||
<meta name="twitter:description" | ||
content="Integrate Twitch Live, YouTube Live, YouTube Latest, and YouTube Shorts Latest directly into your Discord server with Doras.to's embeds." /> | ||
<meta name="twitter:image" content="/favicon.ico" /> | ||
<meta name="twitter:card" content="summary_large_image" /> | ||
|
||
<title>Welcome to the Doras.to Discord Bot</title> | ||
<style> | ||
:root { | ||
--background: 0 0% 6.27%; | ||
--foreground: 0 0% 98.04%; | ||
--card: 0 0% 8%; | ||
--card-foreground: 0 0% 98.04%; | ||
--popover: 0 0% 12.16%; | ||
--popover-foreground: 0 0% 98.04%; | ||
--muted: 0 0% 14.9%; | ||
--muted-foreground: 0 0% 65.1%; | ||
--accent: 0 0% 18.82%; | ||
--accent-foreground: 0 0% 98.04%; | ||
--success: 120 56.52% 54.9%; | ||
--destructive: 2.77 56.52% 54.9%; | ||
--border: 0 0% 14.51%; | ||
--input: 2.77 56.52% 54.9%; | ||
--primary: 2.77 56.52% 54.9%; | ||
--primary-foreground: 0 0% 98.04%; | ||
} | ||
|
||
body { | ||
background-color: hsl(var(--background)); | ||
color: hsl(var(--foreground)); | ||
font-family: "Montserrat Variable", sans-serif; | ||
text-align: center; | ||
padding: 50px; | ||
} | ||
|
||
.logo { | ||
width: 150px; | ||
margin-bottom: 30px; | ||
} | ||
|
||
h1 { | ||
font-size: 50px; | ||
color: hsl(var(--primary)); | ||
margin-bottom: 20px; | ||
} | ||
|
||
p { | ||
font-size: 18px; | ||
color: hsl(var(--muted-foreground)); | ||
} | ||
|
||
.container { | ||
max-width: 500px; | ||
margin: 0 auto; | ||
background-color: hsl(var(--card)); | ||
padding: 40px; | ||
border-radius: 10px; | ||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
a { | ||
color: hsl(var(--primary)); | ||
text-decoration: none; | ||
} | ||
|
||
a:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
.features { | ||
margin-top: 30px; | ||
font-size: 18px; | ||
text-align: left; | ||
} | ||
|
||
.feature-item { | ||
margin: 10px 0; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div class="container"> | ||
<img src="favicon.ico" alt="Doras.to Bot Logo" class="logo" /> | ||
<h1>Welcome to the Doras.to Discord Bot!</h1> | ||
|
||
<ul class="features"> | ||
<li>🚨 <strong>Twitch Live Streams</strong>: Get live Twitch notifications directly in your Discord server. | ||
</li> | ||
<li>📺 <strong>YouTube Live Streams</strong>: Stay updated with YouTube Live streams, right in Discord.</li> | ||
<li>🎬 <strong>Latest YouTube Videos</strong>: View the latest videos from YouTube, embedded in your server. | ||
</li> | ||
<li>📱 <strong>YouTube Shorts Latest</strong>: See the latest YouTube Shorts in your Discord server.</li> | ||
</ul> | ||
|
||
<p> | ||
For live stream announcements, you can choose whether the announcement should disappear when the stream | ||
ends, | ||
or if it should change its URL to the VOD (Video on Demand) once the stream is over. | ||
</p> | ||
|
||
<p> | ||
You also have full control over where the announcements are posted and the ability to customize the alert | ||
messages! | ||
</p> | ||
|
||
<p>To add the bot to your server, click the link below:</p> | ||
<p><a href="https://discord.com/oauth2/authorize?client_id=1178674222873198612" target="_blank">Add Doras.to Bot | ||
to your server</a></p> | ||
</div> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.