Only offer reply and reactions on bot messages
The user's own messages no longer get the reply and react row. A bot's reaction to one still shows, read-only, and react-message refuses a reaction on the user's own message. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -6,11 +6,15 @@ import MessageReactionChip from "./message-reaction-chip";
|
||||
type Props = {
|
||||
message_id: number;
|
||||
reactions?: BotMessageReaction[];
|
||||
onReact: (params: { message_id: number; emoji: BotMessageReactionEmoji }) => void;
|
||||
/**
|
||||
* Left out where the reactions only show (the user's own messages).
|
||||
*/
|
||||
onReact?: (params: { message_id: number; emoji: BotMessageReactionEmoji }) => void;
|
||||
};
|
||||
|
||||
/**
|
||||
* The reactions a message has, one chip per emoji, each toggleable.
|
||||
* The reactions a message has, one chip per emoji, each toggleable when
|
||||
* `onReact` is given.
|
||||
*/
|
||||
export default function MessageReactions({ message_id, reactions, onReact }: Props) {
|
||||
if (!reactions?.length) return null;
|
||||
@@ -23,7 +27,7 @@ export default function MessageReactions({ message_id, reactions, onReact }: Pro
|
||||
emoji={reaction.emoji}
|
||||
count={reaction.count}
|
||||
mine={reaction.mine}
|
||||
onToggle={() => onReact({ message_id, emoji: reaction.emoji })}
|
||||
onToggle={onReact ? () => onReact({ message_id, emoji: reaction.emoji }) : undefined}
|
||||
/>
|
||||
))}
|
||||
</Row>
|
||||
|
||||
Reference in New Issue
Block a user