Skip to content

Commit

Permalink
chore: add simple embed displaying
Browse files Browse the repository at this point in the history
  • Loading branch information
Calvin Rohloff committed Sep 19, 2024
1 parent 8887515 commit c378591
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/discord/structures/Message.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Attachment } from './Attachment';
import { Embed } from './Embed';
import { Reaction } from './Reaction';
import { Snowflake } from './Snowflake';
import { IUserData } from './user/BaseUser';
Expand All @@ -11,4 +12,5 @@ export interface Message {
author: IUserData;
channel_id: Snowflake;
reactions?: Reaction[];
embeds: Embed[];
}
9 changes: 9 additions & 0 deletions src/renderer/components/channel/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ export default function Message({ message }: MessageProps) {
<p className="Message--content">{message.content}</p>
)}

<div className="Message--embeds-container">
{message.embeds.map((embed, index) => {
return (
// eslint-disable-next-line react/no-array-index-key
<div key={`Embed:${message.id}:${index}`}>{embed.title}</div>
);
})}
</div>

<div className="Message--attachments-container">
{message.attachments.map((attachment) => {
return (
Expand Down

0 comments on commit c378591

Please sign in to comment.