mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-11 10:26:21 +00:00
Add ChannelStore and Message import to holynotes plugin
This commit is contained in:
parent
79621f67ef
commit
60cd63163f
1 changed files with 5 additions and 3 deletions
|
@ -24,7 +24,8 @@ import { addButton, removeButton } from "@api/MessagePopover";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import { openModal } from "@utils/modal";
|
import { openModal } from "@utils/modal";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { Menu } from "@webpack/common";
|
import { ChannelStore, Menu } from "@webpack/common";
|
||||||
|
import { Message } from "discord-types/general";
|
||||||
|
|
||||||
import { Popover as NoteButtonPopover } from "./components/icons/NoteButton";
|
import { Popover as NoteButtonPopover } from "./components/icons/NoteButton";
|
||||||
import { NoteModal } from "./components/modals/Notebook";
|
import { NoteModal } from "./components/modals/Notebook";
|
||||||
|
@ -33,10 +34,9 @@ import { DataStoreToCache } from "./utils";
|
||||||
|
|
||||||
const messageContextMenuPatch: NavContextMenuPatchCallback = async (children, { message }: { message: Message; }) => {
|
const messageContextMenuPatch: NavContextMenuPatchCallback = async (children, { message }: { message: Message; }) => {
|
||||||
children.push(
|
children.push(
|
||||||
<Menu.MenuItem label="Add Messagge To" id="add-message-to-note">
|
<Menu.MenuItem label="Add Message To" id="add-message-to-note">
|
||||||
{Object.keys(noteHandler.getAllNotes()).map((notebook: string, index: number) => (
|
{Object.keys(noteHandler.getAllNotes()).map((notebook: string, index: number) => (
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
key={index}
|
|
||||||
label={notebook}
|
label={notebook}
|
||||||
id={notebook}
|
id={notebook}
|
||||||
action={() => noteHandler.addNote(message, notebook)}
|
action={() => noteHandler.addNote(message, notebook)}
|
||||||
|
@ -71,6 +71,8 @@ export default definePlugin({
|
||||||
return {
|
return {
|
||||||
label: "Save Note",
|
label: "Save Note",
|
||||||
icon: NoteButtonPopover,
|
icon: NoteButtonPopover,
|
||||||
|
message: message,
|
||||||
|
channel: ChannelStore.getChannel(message.channel_id),
|
||||||
onClick: () => noteHandler.addNote(message, "Main")
|
onClick: () => noteHandler.addNote(message, "Main")
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue