+
>
);
};
@@ -125,17 +125,14 @@ const MessagePreview = findComponentByCodeLazy<{
compact: boolean,
isGroupStart: boolean,
className: string,
- hideSimpleEmbedContent: boolean
+ hideSimpleEmbedContent: boolean;
}>(/previewGuildId:\i,preview:\i,/);
-const createMessage = findByCodeLazy(/channelId:\i,content:\i,tts:\i=!1,/);
-const populateMessagePrototype = findByCodeLazy(/PREMIUM_REFERRAL&&\(\i=\i.default.isProbablyAValidSnowflake\(/);
+const createBotMessage = findByCodeLazy('username:"Clyde"');
+const populateMessagePrototype = findByCodeLazy("isProbablyAValidSnowflake", "messageReference:");
-const DemoMessage = (props: { msgId, compact, message, date: Date | undefined, isGroupStart?: boolean }) => {
- const message = createMessage({
- content: props.message || "This is a demo message to preview the custom timestamps.",
- channelId: "1337",
- state: "SENT"
- });
+const DemoMessage = (props: { msgId, compact, message, date: Date | undefined, isGroupStart?: boolean; }) => {
+ const message = createBotMessage({ content: props.message, channelId: "1337", embeds: [] });
+ message.author = UserStore.getCurrentUser();
message.id = props.msgId;
message.timestamp = moment(props.date ?? new Date());
const user = UserStore.getCurrentUser();
@@ -169,14 +166,14 @@ const DemoMessageContainer = ErrorBoundary.wrap(() => {
return (
setIsCompact(!isCompact)}>
+ message={`Click me to switch to ${isCompact ? "cozy" : "compact"} mode`} isGroupStart={true}
+ date={aMonthAgo.current} />
+ isGroupStart={true} date={lastWeek.current} />
+ isGroupStart={true} date={yesterday.current} />
+ date={today.current} />
);
}, { noop: true });
@@ -196,12 +193,12 @@ const settings = definePluginSettings({
return (
<>
-
+
{Object.entries(timeFormats).map(([key, value]) => (
{key === "sameDayFormat" && (
-
+
Calendar formats
How to format the [calendar] value if used in the above timestamps.
@@ -229,7 +226,7 @@ const settings = definePluginSettings({
lastDayFormat: string;
lastWeekFormat: string;
sameElseFormat: string;
- }
+ };
}>();
export default definePlugin({