Update LastMessageDate.plugin.js

This commit is contained in:
Mirco Wittrien 2022-12-20 11:23:40 +01:00
parent c0feb254f1
commit 0cf2ecbe71
1 changed files with 8 additions and 4 deletions

View File

@ -2,7 +2,7 @@
* @name LastMessageDate * @name LastMessageDate
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 1.3.4 * @version 1.3.5
* @description Displays the Last Message Date of a Member for the current Server/DM in the UserPopout and UserModal * @description Displays the Last Message Date of a Member for the current Server/DM in the UserPopout and UserModal
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -14,8 +14,8 @@
module.exports = (_ => { module.exports = (_ => {
const changeLog = { const changeLog = {
"improved": { "fixed": {
"Jump To": "Clicking on the Date in the Popout/Profile will now jump to the targeted Message" "NSFW": "Forgot to include nsfw channels in the search, resulting in false timestamps"
} }
}; };
@ -72,8 +72,12 @@ module.exports = (_ => {
queuedInstances[this.props.guildId][this.props.user.id] = [].concat(queuedInstances[this.props.guildId][this.props.user.id]).filter(n => n); queuedInstances[this.props.guildId][this.props.user.id] = [].concat(queuedInstances[this.props.guildId][this.props.user.id]).filter(n => n);
BDFDB.LibraryModules.APIUtils.get({ BDFDB.LibraryModules.APIUtils.get({
url: this.props.isGuild ? BDFDB.DiscordConstants.Endpoints.SEARCH_GUILD(this.props.guildId) : BDFDB.DiscordConstants.Endpoints.SEARCH_CHANNEL(this.props.channelId), url: this.props.isGuild ? BDFDB.DiscordConstants.Endpoints.SEARCH_GUILD(this.props.guildId) : BDFDB.DiscordConstants.Endpoints.SEARCH_CHANNEL(this.props.channelId),
query: BDFDB.LibraryModules.APIEncodeUtils.stringify({author_id: this.props.user.id}) query: BDFDB.LibraryModules.APIEncodeUtils.stringify({
author_id: this.props.user.id,
include_nsfw: true
})
}).then(result => { }).then(result => {
console.log(result);
delete requestedUsers[this.props.guildId][this.props.user.id]; delete requestedUsers[this.props.guildId][this.props.user.id];
if (typeof result.body.retry_after != "number") { if (typeof result.body.retry_after != "number") {
if (result.body.messages && Array.isArray(result.body.messages[0])) { if (result.body.messages && Array.isArray(result.body.messages[0])) {