snapshot rollout phase 1
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
const {
|
||||
buildProfileOverview,
|
||||
buildProfileButtons
|
||||
} = require("../../utils/profileSystem");
|
||||
|
||||
const {
|
||||
temporaryEphemeralReply
|
||||
} = require("../../utils/cookieEconomy");
|
||||
|
||||
module.exports = {
|
||||
name: "crumbSaucerProfile",
|
||||
|
||||
async execute(interaction) {
|
||||
const footer =
|
||||
interaction.message
|
||||
?.embeds?.[0]
|
||||
?.footer
|
||||
?.text;
|
||||
|
||||
const [
|
||||
type,
|
||||
ownerId
|
||||
] = footer?.split(":") ?? [];
|
||||
|
||||
|
||||
if (
|
||||
type !== "crumbSaucer" ||
|
||||
ownerId !== interaction.user.id
|
||||
) {
|
||||
return temporaryEphemeralReply(
|
||||
interaction,
|
||||
{
|
||||
content:
|
||||
"This isn't your Crumb Saucer session."
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
const embed =
|
||||
await buildProfileOverview(
|
||||
interaction.guildId,
|
||||
interaction.user,
|
||||
interaction.user.id
|
||||
);
|
||||
|
||||
|
||||
return interaction.update({
|
||||
embeds: [embed],
|
||||
components:
|
||||
buildProfileButtons(
|
||||
"overview",
|
||||
0,
|
||||
1
|
||||
)
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user