Created
June 14, 2021 22:53
-
-
Save loom4k/b443aa8b93e79cbb23b0b7d203feb87c to your computer and use it in GitHub Desktop.
How to get your Discord Status in React using react-use-lanyard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LanyardWebsocket, useLanyard } from "react-use-lanyard"; | |
import { FC } from "react"; | |
export const Status: FC = () => { | |
const { loading, status } = useLanyard({ | |
userId: "534165671651573781", | |
socket: true, | |
}) as LanyardWebsocket; | |
return ( | |
<span>{status?.discord_status}</span> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment