mirror of
https://github.com/Equicord/Equicord.git
synced 2025-03-30 12:11:58 -04:00
Add Freakyness to your Discord
This commit is contained in:
parent
96df3abaac
commit
7fa7c28c6f
1 changed files with 41 additions and 0 deletions
41
src/equicordplugins/Freakcord/index.tsx
Normal file
41
src/equicordplugins/Freakcord/index.tsx
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Vencord, a Discord client mod
|
||||
* Copyright (c) 2024 Vendicated and contributors
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { addChatBarButton, ChatBarButton, ChatBarButtonFactory, removeChatBarButton } from "@api/ChatButtons";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import { getCurrentChannel, sendMessage } from "@utils/discord";
|
||||
import definePlugin from "@utils/types";
|
||||
const audioURL = "https://cdn.nest.rip/uploads/5919aa31-e61b-421d-af08-ad7ddacd28ea.ogg";
|
||||
const audioPlayer = new Audio(audioURL);
|
||||
async function handleButtonClick() {
|
||||
const channel = getCurrentChannel();
|
||||
if (channel) {
|
||||
sendMessage(channel.id, { content: "Freakcord" });
|
||||
audioPlayer.play().catch(console.error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const ChatBarIcon: ChatBarButtonFactory = () => {
|
||||
return (
|
||||
<ChatBarButton tooltip="Freakcord 👅" onClick={handleButtonClick}>
|
||||
<img
|
||||
src="https://cdn.nest.rip/uploads/10f3f862-afd2-4244-964f-f48219e89d8e.png"
|
||||
width="24"
|
||||
style={{ objectFit: "contain" }}
|
||||
/>
|
||||
</ChatBarButton>
|
||||
);
|
||||
};
|
||||
|
||||
export default definePlugin({
|
||||
name: "Freakcord",
|
||||
description: "Adds freakness to your discord experience.",
|
||||
authors:
|
||||
[EquicordDevs.Crxa],
|
||||
start: () => addChatBarButton("Freakcord", ChatBarIcon),
|
||||
stop: () => removeChatBarButton("Freakcord")
|
||||
});
|
Loading…
Add table
Reference in a new issue