import { Wrench } from "@styled-icons/boxicons-solid"; import { Channels } from "revolt.js/dist/api/objects"; import { useContext } from "preact/hooks"; import PaintCounter from "../../lib/PaintCounter"; import { TextReact } from "../../lib/i18n"; import { AppContext } from "../../context/revoltjs/RevoltClient"; import { useData, useUserPermission } from "../../context/revoltjs/hooks"; import Header from "../../components/ui/Header"; export default function Developer() { // const voice = useContext(VoiceContext); const client = useContext(AppContext); const userPermission = useUserPermission(client.user!._id); return (
Developer Tab
User ID: {client.user!._id}
Permission against self: {userPermission}
GAMING! }} />
{/* Voice Status: {VoiceStatus[voice.status]}
Voice Room ID: {voice.roomId || "undefined"}
Voice Participants: [ {Array.from(voice.participants.keys()).join(", ")}]
*/}
); } function DataTest() { const channel_id = ( useContext(AppContext) .channels.toArray() .find((x) => x.channel_type === "Group") as Channels.GroupChannel )._id; const data = useData( (client) => { return { name: (client.channels.get(channel_id) as Channels.GroupChannel) .name, }; }, [{ key: "channels", id: channel_id }], ); return (
Channel name: {data.name}
); }