Skip to content

Commit

Permalink
Merge pull request #87 from Markoudstaal/79-cant-set-bot-status-with-…
Browse files Browse the repository at this point in the history
…discordactivity

fix discordActivity on output payload
  • Loading branch information
javis86 authored Jun 14, 2023
2 parents 3dcecbe + e45800e commit e3a7023
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog\


## 3.4.4
* Hotfix - #73 Can't set bot status with discordActivity

## 3.4.3
* Hotfix - [#85 TypeError: channel.isTextBased is not a function](https://github.com/Markoudstaal/node-red-contrib-discord-advanced/issues/85) Move to Discord.js 14.11.0

Expand Down
7 changes: 4 additions & 3 deletions discord/discordActivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ module.exports = function (RED) {

bot.user.setPresence({ activities: [{ name: msg.text, type: type, url: url }], status: status });

msg.payload.status = bot.presence['status'];
msg.payload.bot = bot.presence.activities[0];
msg.payload = {
status: bot.presence['status'],
bot: bot.presence.activities[0]
}

node.status({ fill: "green", shape: "dot", text: "Bot Activities Changed" });
node.send(msg);
Expand All @@ -27,7 +29,6 @@ module.exports = function (RED) {
text: error
});
}

});

node.on('close', function () {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-discord-advanced",
"version": "3.4.3",
"version": "3.4.4",
"description": "Recieve, send, edit, reply, react to and delete Discord messages, handle interactions and much more in Node-RED.",
"main": "discord/discord.js",
"scripts": {
Expand Down

0 comments on commit e3a7023

Please sign in to comment.