()
| 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: |
no test coverage detected