mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-07 07:56:12 +02:00
fixed error with buildHelper
This commit is contained in:
committed by
Jean-Philippe Sirois
parent
71b6078e40
commit
2fd129acc2
@@ -11,16 +11,14 @@ module.exports = {
|
|||||||
const hash = identifier.slice(hashLocation + 1)
|
const hash = identifier.slice(hashLocation + 1)
|
||||||
return [name, hash]
|
return [name, hash]
|
||||||
},
|
},
|
||||||
getDefaultAvatar(name) {
|
getDefaultAvatar(hash) {
|
||||||
const [_, hash] = this.splitHash(hashLocation)
|
const avatar = hash % DEFAULT_AVATAR_MODULO
|
||||||
|
|
||||||
const avatar = Number(hash) % DEFAULT_AVATAR_MODULO
|
|
||||||
return `https://cdn.discordapp.com/embed/avatars/${avatar}.png`
|
return `https://cdn.discordapp.com/embed/avatars/${avatar}.png`
|
||||||
},
|
},
|
||||||
resolveAuthor(users, author) {
|
resolveAuthor(users, author) {
|
||||||
const target = users.find(user => user.identifier === author)
|
const target = users.find(user => user.identifier === author)
|
||||||
const [name, hash] = this.splitHash(author)
|
const [name, hash] = this.splitHash(author)
|
||||||
const avatar = target ? target.avatar : this.getDefaultAvatar(author)
|
const avatar = target ? target.avatar : this.getDefaultAvatar(hash)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name,
|
name,
|
||||||
|
|||||||
Reference in New Issue
Block a user