From b251942e4047e8cf3ff39ccbaef1f89ac35bbe41 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Mon, 4 May 2020 21:56:15 +0300 Subject: [PATCH] discordapp.com -> discord.com --- backend/src/api/auth.ts | 6 +++--- backend/src/plugins/Reminders.ts | 2 +- backend/src/utils.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/api/auth.ts b/backend/src/api/auth.ts index 2f232af2..cc3750c7 100644 --- a/backend/src/api/auth.ts +++ b/backend/src/api/auth.ts @@ -22,7 +22,7 @@ declare global { } } -const DISCORD_API_URL = "https://discordapp.com/api"; +const DISCORD_API_URL = "https://discord.com/api"; function simpleDiscordAPIRequest(bearerToken, path): Promise { return new Promise((resolve, reject) => { @@ -94,8 +94,8 @@ export function initAuth(app: express.Express) { passport.use( new OAuth2Strategy( { - authorizationURL: "https://discordapp.com/api/oauth2/authorize", - tokenURL: "https://discordapp.com/api/oauth2/token", + authorizationURL: "https://discord.com/api/oauth2/authorize", + tokenURL: "https://discord.com/api/oauth2/token", clientID: process.env.CLIENT_ID, clientSecret: process.env.CLIENT_SECRET, callbackURL: process.env.OAUTH_CALLBACK_URL, diff --git a/backend/src/plugins/Reminders.ts b/backend/src/plugins/Reminders.ts index 6b38d05d..c6d057b8 100644 --- a/backend/src/plugins/Reminders.ts +++ b/backend/src/plugins/Reminders.ts @@ -136,7 +136,7 @@ export class RemindersPlugin extends ZeppelinPlugin { return; } - const reminderBody = args.reminder || `https://discordapp.com/channels/${this.guildId}/${msg.channel.id}/${msg.id}`; + const reminderBody = args.reminder || `https://discord.com/channels/${this.guildId}/${msg.channel.id}/${msg.id}`; await this.reminders.add( msg.author.id, msg.channel.id, diff --git a/backend/src/utils.ts b/backend/src/utils.ts index 3ab14073..ec855f0c 100644 --- a/backend/src/utils.ts +++ b/backend/src/utils.ts @@ -423,7 +423,7 @@ export function getUrlsInString(str: string, unique = false): MatchedURL[] { } export function getInviteCodesInString(str: string): string[] { - const inviteCodeRegex = /(?:discord.gg|discordapp.com\/invite)\/([a-z0-9]+)/gi; + const inviteCodeRegex = /(?:discord.gg|discordapp.com\/invite|discord.com\/invite)\/([a-z0-9]+)/gi; return Array.from(str.matchAll(inviteCodeRegex)).map(m => m[1]); } @@ -559,7 +559,7 @@ export function disableCodeBlocks(content: string): string { } export function useMediaUrls(content: string): string { - return content.replace(/cdn\.discordapp\.com/g, "media.discordapp.net"); + return content.replace(/cdn\.discord(app)?\.com/g, "media.discordapp.net"); } export function chunkArray(arr: T[], chunkSize): T[][] { @@ -1071,7 +1071,7 @@ export function messageLink(guildIdOrMessage: string | Message | null, channelId guildId = guildIdOrMessage; } - return `https://discordapp.com/channels/${guildId}/${channelId}/${messageId}`; + return `https://discord.com/channels/${guildId}/${channelId}/${messageId}`; } export function isValidEmbed(embed: any): boolean {