MCPcopy Create free account
hub / github.com/MathMan05/Fermi / setupcmenu

Method setupcmenu

src/webpage/message.ts:93–311  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91 Message.contextmenu.addButton(
92 () => I18n.message.edit(),
93 function (this: Message) {
94 this.setEdit();
95 },
96 {
97 visible: function () {
98 return this.author.id === this.localuser.user.id && editTypes.has(this.type);
99 },
100
101 icon: {
102 css: "svg-edit",
103 },
104 },
105 );
106 Message.contextmenu.addButton(
107 () => I18n.reply(),
108 function (this: Message) {
109 this.channel.setReplying(this);
110 },
111 {
112 icon: {
113 css: "svg-reply",
114 },
115 visible: function () {
116 return !this.ephemeral && this.channel.hasPermission("SEND_MESSAGES");
117 },
118 },
119 );
120
121 Message.contextmenu.addButton(
122 () => I18n.message.reactionAdd(),
123 function (this: Message, _, e: MouseEvent) {
124 Emoji.emojiPicker(e.x, e.y, this.localuser).then((_) => {
125 this.reactionToggle(_);
126 });
127 },
128 {
129 icon: {
130 css: "svg-emoji",
131 },
132 visible: function () {
133 return this.channel.hasPermission("ADD_REACTIONS");
134 },
135 },
136 );
137
138 Message.contextmenu.addButton(
139 () => I18n.message.createThread(),
140 function () {
141 const dio = new Dialog(I18n.message.threadOptions());
142 const opt = dio.options.addForm(
143 "",
144 (body) => {
145 const channelJson = body as channeljson;
146 this.guild.goToThread(channelJson.id);
147 dio.hide();
148 },
149 {
150 fetchURL:

Callers 1

setupMethod · 0.80

Calls 15

setEditMethod · 0.95
reactionToggleMethod · 0.95
hideMethod · 0.95
showMethod · 0.95
viewReactionsMethod · 0.95
confirmDeleteMethod · 0.95
canDeleteMethod · 0.95
confirmDeletePollMethod · 0.95
getDeveloperSettingsFunction · 0.85
setReplyingMethod · 0.80
reactionAddMethod · 0.80
addFormMethod · 0.80

Tested by

no test coverage detected