feat: using koreanbots cdn for og image

This commit is contained in:
wonderlandpark 2021-05-05 22:25:29 +09:00
parent 423e7201f8
commit bc35577dc0
No known key found for this signature in database
GPG Key ID: E3E650B146478C64
2 changed files with 4 additions and 12 deletions

View File

@ -9,7 +9,7 @@ import { SnowflakeUtil } from 'discord.js'
import { ParsedUrlQuery } from 'querystring'
import { Bot, ResponseProps, Theme, User } from '@types'
import { git, reportCats, Status } from '@utils/Constants'
import { git, KoreanbotsEndPoints, reportCats, Status } from '@utils/Constants'
import { get } from '@utils/Query'
import Day from '@utils/Day'
import { ReportSchema } from '@utils/Yup'
@ -56,11 +56,7 @@ const Bots: NextPage<BotsProps> = ({ data, desc, date, user, theme, csrfToken })
<SEO
title={data.name}
description={data.intro}
image={
data.avatar
? `https://cdn.discordapp.com/avatars/${data.id}/${data.avatar}.png?size=1024`
: `https://cdn.discordapp.com/embed/avatars/${Number(data.tag) % 5}.png?size=1024`
}
image={KoreanbotsEndPoints.CDN.avatar(data.id, { format: 'png', size: 256 })}
/>
{
data.state === 'blocked' ? <div className='pb-40'>

View File

@ -15,7 +15,7 @@ import Fetch from '@utils/Fetch'
import { ReportSchema } from '@utils/Yup'
import NotFound from '../404'
import { reportCats } from '@utils/Constants'
import { KoreanbotsEndPoints, reportCats } from '@utils/Constants'
const Container = dynamic(() => import('@components/Container'))
const SEO = dynamic(() => import('@components/SEO'))
@ -50,11 +50,7 @@ const Users: NextPage<UserProps> = ({ user, data, csrfToken, theme }) => {
.map(el => el.name)
.join(', ')}#{} .`
)}
image={
data.avatar
? `https://cdn.discordapp.com/avatars/${data.id}/${data.avatar}.png?size=1024`
: `https://cdn.discordapp.com/embed/avatars/${Number(data.tag) % 5}.png?size=1024`
}
image={KoreanbotsEndPoints.CDN.avatar(data.id, { format: 'png', size: 256 })}
/>
<div className='lg:flex'>
<div className='w-full text-center lg:w-1/4'>