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 { ParsedUrlQuery } from 'querystring'
import { Bot, ResponseProps, Theme, User } from '@types' 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 { get } from '@utils/Query'
import Day from '@utils/Day' import Day from '@utils/Day'
import { ReportSchema } from '@utils/Yup' import { ReportSchema } from '@utils/Yup'
@ -56,11 +56,7 @@ const Bots: NextPage<BotsProps> = ({ data, desc, date, user, theme, csrfToken })
<SEO <SEO
title={data.name} title={data.name}
description={data.intro} description={data.intro}
image={ image={KoreanbotsEndPoints.CDN.avatar(data.id, { format: 'png', size: 256 })}
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`
}
/> />
{ {
data.state === 'blocked' ? <div className='pb-40'> data.state === 'blocked' ? <div className='pb-40'>

View File

@ -15,7 +15,7 @@ import Fetch from '@utils/Fetch'
import { ReportSchema } from '@utils/Yup' import { ReportSchema } from '@utils/Yup'
import NotFound from '../404' import NotFound from '../404'
import { reportCats } from '@utils/Constants' import { KoreanbotsEndPoints, reportCats } from '@utils/Constants'
const Container = dynamic(() => import('@components/Container')) const Container = dynamic(() => import('@components/Container'))
const SEO = dynamic(() => import('@components/SEO')) const SEO = dynamic(() => import('@components/SEO'))
@ -50,11 +50,7 @@ const Users: NextPage<UserProps> = ({ user, data, csrfToken, theme }) => {
.map(el => el.name) .map(el => el.name)
.join(', ')}#{} .` .join(', ')}#{} .`
)} )}
image={ image={KoreanbotsEndPoints.CDN.avatar(data.id, { format: 'png', size: 256 })}
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`
}
/> />
<div className='lg:flex'> <div className='lg:flex'>
<div className='w-full text-center lg:w-1/4'> <div className='w-full text-center lg:w-1/4'>