Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sticker #1032

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
70 changes: 45 additions & 25 deletions actions/store_message_info_MOD.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
'Replied-to Message Channel ID',
'Replied-to Message Guild ID',
'Is Reply to Message?',
'Message Stickers Count', // Added option for sticker count
];
return `${presets.getMessageText(data.message, data.varName)} - ${info[parseInt(data.info, 10)]}`;
},
Expand Down Expand Up @@ -137,6 +138,9 @@
case 27:
dataType = 'Boolean';
break;
case 28: // Added case for storing sticker count
dataType = 'Number';
break;
default:
break;
}
Expand All @@ -153,7 +157,13 @@
// This will make it so the patch version (0.0.X) is not checked.
// ---------------------------------------------------------------------

meta: { version: '2.1.7', preciseCheck: true, author: null, authorUrl: null, downloadUrl: null },
meta: {
version: '2.1.7',
preciseCheck: true,
author: null,
authorUrl: null,
downloadUrl: null,
},

// ---------------------------------------------------------------------
// Action Fields
Expand Down Expand Up @@ -181,35 +191,36 @@
<br><br><br>

<div style="padding-top: 8px;">
<span class="dbminputlabel">Source Info</span><br>
<select id="info" class="round">
<option value="0" selected>Message Object</option>
<option value="1">Message ID</option>
<option value="2">Message Text</option>
<option value="3">Message Author</option>
<option value="4">Message Channel</option>
<option value="5">Message Timestamp</option>
<option value="6">Message Is Pinned?</option>
<span class="dbminputlabel">Source Info</span><br>
<select id="info" class="round">
<option value="0" selected>Message Object</option>
<option value="1">Message ID</option>
<option value="2">Message Text</option>
<option value="3">Message Author</option>
<option value="4">Message Channel</option>
<option value="5">Message Timestamp</option>
<option value="6">Message Is Pinned?</option>
<option value="7">Message Is TTS?</option>
<option value="8">Message Attachments List</option>
<option value="9">Message Edits</option>
<option value="12">Messages Reactions Count</option>
<option value="13">Messages Mentioned Users List</option>
<option value="14">Messages Mentioned Users Count</option>
<option value="15">Message URL</option>
<option value="16">Message Creation Date</option>
<option value="17">Message Content Length</option>
<option value="18">Message Attachments Count</option>
<option value="19">Message Guild</option>
<option value="20">Message Type</option>
<option value="21">Message Webhook ID</option>
<option value="22">Message Embed Object</option>
<option value="9">Message Edits</option>
<option value="12">Messages Reactions Count</option>
<option value="13">Messages Mentioned Users List</option>
<option value="14">Messages Mentioned Users Count</option>
<option value="15">Message URL</option>
<option value="16">Message Creation Date</option>
<option value="17">Message Content Length</option>
<option value="18">Message Attachments Count</option>
<option value="19">Message Guild</option>
<option value="20">Message Type</option>
<option value="21">Message Webhook ID</option>
<option value="22">Message Embed Object</option>
<option value="23">Message Reference Object</option>
<option value="24">Replied-to Message ID</option>
<option value="25">Replied-to Message Channel ID</option>
<option value="26">Replied-to Message Guild ID</option>
<option value="27">Is Reply to Message?</option>
</select>
<option value="28">Message Stickers Count</option> <!-- Added option for sticker count -->
</select>
</div>

<br>
Expand All @@ -235,7 +246,11 @@
// ---------------------------------------------------------------------
async action(cache) {
const data = cache.actions[cache.index];
const msg = await this.getMessageFromData(data.message, data.varName, cache);
const msg = await this.getMessageFromData(

Check failure on line 249 in actions/store_message_info_MOD.js

View workflow job for this annotation

GitHub Actions / ESLint

Replace `⏎······data.message,⏎······data.varName,⏎······cache,⏎····` with `data.message,·data.varName,·cache`
data.message,
data.varName,
cache,
);

if (!msg) {
this.callNextAction(cache);
Expand Down Expand Up @@ -324,14 +339,19 @@
case 27:
result = msg.type === 'REPLY' && msg.reference?.messageId !== undefined;
break;
case 28: // Added case for storing sticker count
result = msg.stickers ? msg.stickers.size : 0;
break;
default:
break;
}

if (result !== undefined) {
const storage = parseInt(data.storage, 10);
const varName2 = this.evalMessage(data.varName2, cache);
this.storeValue(result, storage, varName2, cache);
}

this.callNextAction(cache);
},

Expand All @@ -344,4 +364,4 @@
// functions you wish to overwrite.
// ---------------------------------------------------------------------
mod() {},
};
};

Check failure on line 367 in actions/store_message_info_MOD.js

View workflow job for this annotation

GitHub Actions / ESLint

Insert `⏎`
Loading