Skip to content

Instantly share code, notes, and snippets.

@loom4k
Created June 14, 2021 22:53
Show Gist options
  • Save loom4k/b443aa8b93e79cbb23b0b7d203feb87c to your computer and use it in GitHub Desktop.
Save loom4k/b443aa8b93e79cbb23b0b7d203feb87c to your computer and use it in GitHub Desktop.
How to get your Discord Status in React using react-use-lanyard
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