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

Method setupcontextmenu

src/webpage/guild.ts:196–338  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194 emojis: emojipjson[] = [];
195 large!: boolean;
196 readonly stickers = new Map<string, Sticker>();
197 readonly members = new Map<string, Member>();
198 welcomeScreen?: welcomeScreen;
199 static readonly contextmenu = new Contextmenu<Guild, void>("guild menu");
200 static setupcontextmenu() {
201 Guild.contextmenu.addButton(
202 () => I18n.guild.markRead(),
203 function (this: Guild) {
204 this.markAsRead();
205 },
206 );
207 Guild.contextmenu.addSeperator();
208
209 Guild.contextmenu.addButton(
210 () => I18n.guild.makeInvite(),
211 function (this: Guild) {
212 const d = new Dialog("");
213 this.makeInviteMenu(d.options);
214 d.show();
215 },
216 {
217 enabled: function () {
218 return this.member.hasPermission("CREATE_INSTANT_INVITE");
219 },
220 color: "blue",
221 },
222 );
223
224 Guild.contextmenu.addButton(
225 () => I18n.guild.notifications(),
226 function (this: Guild) {
227 this.setnotifcation();
228 },
229 );
230 Guild.contextmenu.addSeperator();
231 this.contextmenu.addButton(
232 () => I18n.user.editServerProfile(),
233 function () {
234 this.member.showEditProfile();
235 },
236 );
237 Guild.contextmenu.addSeperator();
238
239 Guild.contextmenu.addButton(
240 () => I18n.guild.leave(),
241 function (this: Guild) {
242 this.confirmleave();
243 },
244 {
245 visible: function (_) {
246 return this.properties.owner_id !== this.member.user.id;
247 },
248 color: "red",
249 },
250 );
251
252 Guild.contextmenu.addButton(
253 () => I18n.guild.delete(),

Callers 1

guild.tsFile · 0.45

Calls 15

makeInviteMenuMethod · 0.95
showMethod · 0.95
markAsReadMethod · 0.95
setnotifcationMethod · 0.95
confirmleaveMethod · 0.95
confirmDeleteMethod · 0.95
generateSettingsMethod · 0.95
findAdminMethod · 0.95
createchannelsMethod · 0.95
createcategoryMethod · 0.95
getDeveloperSettingsFunction · 0.85
addSeperatorMethod · 0.80

Tested by

no test coverage detected