Skip to content

Commit aab0c7e

Browse files
committed
Update add_reaction.js
1 parent 48fab42 commit aab0c7e

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

bot/actions/add_reaction.js

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = {
2828

2929
meta: {
3030
version: "4.0.0",
31-
modVersion: "1.0.0",
31+
modVersion: "1.0.1",
3232
preciseCheck: true,
3333
author: "Shadow",
3434
help: "https://dc.dbm-poland.site",
@@ -47,15 +47,13 @@ module.exports = {
4747
//region # Action HTML
4848
//≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
4949

50-
html(isEvent, data) {
50+
html() {
5151
const mod = `<dbm-mod><info style="opacity: 0.2; transition: opacity 0.3s; font-weight: 900; font-size: 16px; padding: 5px; border-radius: 5px; background: rgba(0, 0, 0, 0.49); border:1px solid rgba(132, 132, 132, 1); position: fixed; bottom: 0; left: 0; z-index: 999999;" onmouseover="this.style.opacity='1'" onmouseout="this.style.opacity='0.2'">Author: <a href="#" style="color:#07f;text-decoration:none;" onclick="require('electron').shell.openExternal('${this.meta.authorUrl}')">${this.meta.author}</a><br>Help: <a href="#" style="color:#07f;text-decoration:none;" onclick="require('electron').shell.openExternal('${this.meta.help}')">click here</a></info><version style="opacity: 0.2; transition: opacity 0.3s; font-weight: 900; font-size: 16px; padding: 5px; border-radius: 5px; background: rgba(0, 0, 0, 0.49); border:1px solid rgba(132, 132, 132, 1); position: fixed; bottom: 0; right: 0; z-index: 999999;" onmouseover="this.style.opacity='1'" onmouseout="this.style.opacity='0.2'"><a href="#" style="color:#07f;text-decoration:none;" onclick="require('electron').shell.openExternal('${this.meta.downloadUrl}')">${this.meta.modVersion}</a></version></dbm-mod>`;
5252
return (
5353
mod +
5454
`
5555
<message-input dropdownLabel="Source Message" selectId="storage" variableContainerId="varNameContainer" variableInputId="varName"></message-input>
56-
5756
<br><br><br>
58-
5957
<div style="padding-top: 8px;">
6058
<div style="float: left; width: 35%;">
6159
<span class="dbminputlabel">Source Emoji</span><br>
@@ -75,7 +73,8 @@ module.exports = {
7573
<span class="dbminputlabel">Variable Name</span><br>
7674
<input id="varName3" class="round" type="text" list="variableList2">
7775
</div>
78-
</div>`
76+
</div>
77+
`
7978
);
8079
},
8180

@@ -129,9 +128,16 @@ module.exports = {
129128
if (type === 4) {
130129
emoji = this.evalMessage(data.varName2, cache);
131130
} else if (type === 0) {
132-
emoji = this.getDBM().Bot.bot.emojis.cache.find(
133-
(e) => e.name === this.evalMessage(data.varName2, cache),
134-
);
131+
const input = this.evalMessage(data.varName2, cache);
132+
if (/^<a?:\w+:\d+>$/.test(input)) {
133+
emoji = input;
134+
} else if (/^\d+$/.test(input)) {
135+
emoji = input;
136+
} else {
137+
emoji = this.getDBM().Bot.bot.emojis.cache.find(
138+
(e) => e.name === input,
139+
);
140+
}
135141
} else {
136142
emoji = this.getVariable(
137143
type,

0 commit comments

Comments
 (0)