diff --git a/src/serviceProviders/discord.js b/src/serviceProviders/discord.js index b995af5..f15f86c 100644 --- a/src/serviceProviders/discord.js +++ b/src/serviceProviders/discord.js @@ -24,7 +24,7 @@ limitations under the License. import * as E from '../enums.js' import { ServiceProvider } from '../serviceProvider.js' -export const reURI = /^https:\/\/discord\.com\/invite\/(.+)/ +export const reURI = /^https:\/\/(?:discord\.gg|discord\.com\/invite)\/(.+)/ /** * @function @@ -89,8 +89,28 @@ export const tests = [ uri: 'https://discord.com/invite/AbCdEfGh', shouldMatch: true }, + { + uri: 'https://discord.gg/AbCdEf', + shouldMatch: true + }, + { + uri: 'https://discord.gg/AbCdEfGh', + shouldMatch: true + }, { uri: 'https://domain.com/invite/AbCdEf', shouldMatch: false + }, + { + uri: 'https://domain.gg/AbCdEf', + shouldMatch: false + }, + { + uri: 'https://discord.com/invite/', + shouldMatch: false + } + { + uri: 'https://discord.gg/', + shouldMatch: false } ]