mirror of
https://github.com/nx-bat/pet-the-pond.git
synced 2026-09-22 10:29:11 -04:00
(commands): i'm losing my mind.
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
import { Command, CommandBuilder, CommandClient, CommandInteraction, Constants, SlashCommand } from "athena-prime";
|
import { Command, CommandBuilder, CommandClient, CommandInteraction, Constants, SlashCommand } from "athena-prime";
|
||||||
import { getUser, setUserPrivacy } from "../../utils";
|
import { getUser, updateUserSettings } from "../../utils";
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
|
|
||||||
@SlashCommand(
|
@SlashCommand(
|
||||||
new CommandBuilder('optin', 'Opt into the Pet the Pond event.')
|
new CommandBuilder('optin', 'Stop counting your pet interactions.')
|
||||||
.setIntegrationTypes(Constants.ApplicationIntegrationType.GuildInstall)
|
.setIntegrationTypes(Constants.ApplicationIntegrationType.GuildInstall)
|
||||||
.setContexts(Constants.InteractionContextType.Guild)
|
.setContexts(Constants.InteractionContextType.Guild)
|
||||||
.setCommandType(Constants.ApplicationCommandType.ChatInput)
|
.setCommandType(Constants.ApplicationCommandType.ChatInput)
|
||||||
@@ -16,7 +16,7 @@ class OptInCommand extends Command<CommandClient> {
|
|||||||
await interaction.defer(true);
|
await interaction.defer(true);
|
||||||
|
|
||||||
const _user = await getUser(interaction.user.id);
|
const _user = await getUser(interaction.user.id);
|
||||||
await setUserPrivacy(_user.user_id, { optin: true });
|
await updateUserSettings(interaction.user.id, { participating: true });
|
||||||
|
|
||||||
await interaction.createMessage({
|
await interaction.createMessage({
|
||||||
content: "Successfully opted in. You'll receive points for your pets!",
|
content: "Successfully opted in. You'll receive points for your pets!",
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { Command, CommandBuilder, CommandClient, CommandInteraction, Constants, SlashCommand } from "athena-prime";
|
import { Command, CommandBuilder, CommandClient, CommandInteraction, Constants, SlashCommand } from "athena-prime";
|
||||||
import { getUser, setUserPrivacy } from "../../utils";
|
import { getUser, updateUserSettings } from "../../utils";
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
|
|
||||||
@SlashCommand(
|
@SlashCommand(
|
||||||
new CommandBuilder('optout', 'Opt out of the Pet the Pond event.')
|
new CommandBuilder('optout', 'Stop counting your pet interactions.')
|
||||||
.setIntegrationTypes(Constants.ApplicationIntegrationType.GuildInstall)
|
.setIntegrationTypes(Constants.ApplicationIntegrationType.GuildInstall)
|
||||||
.setContexts(Constants.InteractionContextType.Guild)
|
.setContexts(Constants.InteractionContextType.Guild)
|
||||||
.setCommandType(Constants.ApplicationCommandType.ChatInput)
|
.setCommandType(Constants.ApplicationCommandType.ChatInput)
|
||||||
@@ -15,8 +15,7 @@ class OptOutCommand extends Command<CommandClient> {
|
|||||||
async handleCommand(context: CommandClient<any, any>, interaction: CommandInteraction) {
|
async handleCommand(context: CommandClient<any, any>, interaction: CommandInteraction) {
|
||||||
await interaction.defer(true);
|
await interaction.defer(true);
|
||||||
|
|
||||||
const _user = await getUser(interaction.user.id);
|
await updateUserSettings(interaction.user.id, { participating: false });
|
||||||
await setUserPrivacy(_user.user_id, { optin: false });
|
|
||||||
|
|
||||||
await interaction.createMessage({
|
await interaction.createMessage({
|
||||||
content: "Successfully opted out. You won't receive any points for petting :<"
|
content: "Successfully opted out. You won't receive any points for petting :<"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class ProfileCommand extends Command<CommandClient> {
|
|||||||
await interaction.createMessage({
|
await interaction.createMessage({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
color: 0xff5555,
|
color: 0xff5555,
|
||||||
description: 'Sorry, I was unable to get your profile. Please try again later.'
|
description: 'There was an error processing your request. Please try again later.'
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user