forked from Mirrors/doipjs
accept discord.gg urls
This commit is contained in:
parent
9b1a5d4d26
commit
6d464176df
1 changed files with 21 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue