aboutsummaryrefslogtreecommitdiff
path: root/src/utils/discord.ts
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2023-04-18 23:12:58 +0200
committerVendicated <vendicated@riseup.net>2023-04-18 23:13:10 +0200
commit8dd70f5d1a5f0aee836d5633d504b75b6513bcc3 (patch)
treeadf91fbf4d6cd56e3a4d8900ed6aa0bafa54f0f7 /src/utils/discord.ts
parent8be6c6e3ceed26c5a4524784339c66d49cb1b278 (diff)
downloadVencord-8dd70f5d1a5f0aee836d5633d504b75b6513bcc3.tar.gz
Vencord-8dd70f5d1a5f0aee836d5633d504b75b6513bcc3.tar.bz2
Vencord-8dd70f5d1a5f0aee836d5633d504b75b6513bcc3.zip
Fix inserting text when markdown preview is off
Diffstat (limited to 'src/utils/discord.ts')
-rw-r--r--src/utils/discord.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/utils/discord.ts b/src/utils/discord.ts
index ec732b4..dfd20e6 100644
--- a/src/utils/discord.ts
+++ b/src/utils/discord.ts
@@ -17,7 +17,7 @@
*/
import { findLazy } from "@webpack";
-import { ChannelStore, GuildStore, PrivateChannelsStore, SelectedChannelStore } from "@webpack/common";
+import { ChannelStore, ComponentDispatch, GuildStore, PrivateChannelsStore, SelectedChannelStore } from "@webpack/common";
import { Guild } from "discord-types/general";
const PreloadedUserSettings = findLazy(m => m.ProtoClass?.typeName.endsWith("PreloadedUserSettings"));
@@ -42,3 +42,10 @@ export const enum Theme {
export function getTheme(): Theme {
return PreloadedUserSettings.getCurrentValue()?.appearance?.theme;
}
+
+export function insertTextIntoChatInputBox(text: string) {
+ ComponentDispatch.dispatchToLastSubscribed("INSERT_TEXT", {
+ rawText: text,
+ plainText: text
+ });
+}