native emoji support

This commit is contained in:
Conrad
2021-06-20 22:15:43 -04:00
parent 71d152a113
commit bf4f6dab8d
3 changed files with 10 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ _Special thanks to [@Phineas](https://github.com/Phineas/) for creating Lanyard,
## Usage
First, join the Lanyard [Discord](https://discord.gg/gYTp9JHrhg) (if you haven't already) for this to work.
First, join the Lanyard [Discord](https://discord.com/invite/WScAm7vNGF) (if you haven't already) for this to work.
In a `README.md` file, include the following, replacing `:id` with your Discord user ID:

View File

@@ -22,7 +22,7 @@ export default function Home() {
<Container>
<p style={{fontSize: "1rem", fontWeight: "bold", marginTop: "1rem"}}>Make sure you're in the <a style={{color: "#fff"}} rel="noreferrer" href="https://discord.gg/gYTp9JHrhg">Discord</a> for this to work.</p>
<p style={{fontSize: "1rem", fontWeight: "bold", marginTop: "1rem"}}>Make sure you're in the <a style={{color: "#fff"}} rel="noreferrer" href="https://discord.com/invite/WScAm7vNGF">Discord</a> for this to work.</p>
<Input maxLength={18} type="text" placeholder="Paste your Discord user ID here" onChange={((e) => setUserId(e.target.value))}>

View File

@@ -162,7 +162,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
white-space: nowrap;
text-overflow: ellipsis;
">
${body.data.activities[0].emoji ?
${body.data.activities[0].emoji && body.data.activities[0].emoji.id ?
`<img src="data:image/png;base64,${await encodeBase64(`https://cdn.discordapp.com/emojis/${body.data.activities[0].emoji.id}.${statusExtension}`)}" style="
width: 15px;
height: 15px;
@@ -172,7 +172,13 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
margin: 0 2px 0 0;
" />`
: ``}
${userStatus}
${body.data.activities[0].emoji && !body.data.activities[0].emoji.id ?
body.data.activities[0].emoji.name + ' ' + userStatus
:
userStatus
}
</h1>`
: ``}
</div>