Merge pull request #50 from oceanprotocol/fix-wrong-discord-number

Fix wrong discord number
This commit is contained in:
Matthias Kretschmann 2021-02-04 14:00:42 +01:00 committed by GitHub
commit c3611e29f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -12,9 +12,10 @@ export default async function fetchDiscord() {
// extract members count from meta description
const metaDescription = data('meta[name="description"]').attr('content')
const regex = /\d+/ // one or more digits
const regex = /\d+[,]\d+/ // one or more digits separated by comma
const number = metaDescription.match(regex)
const members = parseInt(number[0])
const membersNumber = number[0].replace(/,/,'') // eliminate comma from number
const members = parseInt(membersNumber)
log(
'✓ Discord. ' +