aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils')
-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
+ });
+}