Skip to content

Commit

Permalink
chart test
Browse files Browse the repository at this point in the history
  • Loading branch information
LarmuseauNiels committed Apr 19, 2023
1 parent a076c25 commit 1f3a9e9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
5 changes: 3 additions & 2 deletions interactions/commands/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ module.exports = {
.setDescription("Flamingpalm points store")
.setTimestamp()
.setFooter({
text: "Work in progress flamingpalm store",
iconURL: "https://flamingpalm.com/images/FlamingPalmLogoSmall.png",
text: "Flamingpalm store",
iconURL:
"https://flamingpalm.com/assets/images/logo/FlamingPalmLogoSmall.png",
});
let rewards = await global.client.prisma.reward.findMany({
include: { RewardItem: true },
Expand Down
17 changes: 16 additions & 1 deletion interactions/contextmenus/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ module.exports = {
},
},
});
let lastOnline = new Array();
lastOnline = await global.client.prisma
.$queryRaw`select date(TimeStamp) as date, count(*)/4 as hours
from VoiceConnected
where ID = '178435947816419328'
group by date(TimeStamp)
order by date desc
limit 10`;
let labels = lastOnline.map((x) => x.date).join(",");
let data = lastOnline.map((x) => x.hours).join(",");

interaction.guild.members.fetch(interaction.targetId).then((member) => {
let embed = new EmbedBuilder()
.setTitle(member.user.username)
Expand Down Expand Up @@ -53,7 +64,11 @@ module.exports = {
} ${dbinfo?.PointHistory[0]?.points ?? 0}:palm_tree:`,
inline: false,
}
);
)
.setImage(
`https://quickchart.io/chart/render/zm-ac7d2566-6186-4be1-b415-bc30470a6d6b?title=Last 10 days online&labels=${labels}&data1=${data}`
)
.setTimestamp();
interaction.editReply({ embeds: [embed], ephemeral: true });
});
},
Expand Down

0 comments on commit 1f3a9e9

Please sign in to comment.