rai-serge-discord-bot/commands/system/session-id.js

26 lines
930 B
JavaScript
Raw Permalink Normal View History

2023-03-25 13:09:44 -04:00
const { EmbedBuilder } = require('discord.js');
var unirest = require('unirest');
const jsonfile = require('jsonfile')
module.exports = {
name: "view-session-id",
description: "View your currently assigned session ID",
private: true,
run: async (client, interaction) => {
const file = './cache/' + interaction.user.id
2023-03-25 20:00:34 -04:00
jsonfile.readFile(file, function (err, session) {
2023-03-25 13:09:44 -04:00
if (err) return interaction.editReply('Please create a session using /create-session.');
const embed = new EmbedBuilder()
2023-03-25 20:00:34 -04:00
.setColor("#FF0000")
.setTitle("Your current session ID")
.setDescription(`**Session ID:** \`${session.id}\`\n\nThe above ID is a unique session memories are stored for processing.`)
.setTimestamp()
.setFooter({ text: `Requested by ${interaction.user.tag}`, iconURL: `${interaction.user.displayAvatarURL()}` });
interaction.followUp({ embeds: [embed] });
2023-03-25 13:09:44 -04:00
})
},
};