mirror of
https://github.com/nx-bat/pet-the-pond.git
synced 2026-09-22 02:19:10 -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 { getUser, setUserPrivacy } from "../../utils";
|
||||
import { getUser, updateUserSettings } from "../../utils";
|
||||
|
||||
// ----------
|
||||
|
||||
@SlashCommand(
|
||||
new CommandBuilder('optin', 'Opt into the Pet the Pond event.')
|
||||
new CommandBuilder('optin', 'Stop counting your pet interactions.')
|
||||
.setIntegrationTypes(Constants.ApplicationIntegrationType.GuildInstall)
|
||||
.setContexts(Constants.InteractionContextType.Guild)
|
||||
.setCommandType(Constants.ApplicationCommandType.ChatInput)
|
||||
@@ -16,7 +16,7 @@ class OptInCommand extends Command<CommandClient> {
|
||||
await interaction.defer(true);
|
||||
|
||||
const _user = await getUser(interaction.user.id);
|
||||
await setUserPrivacy(_user.user_id, { optin: true });
|
||||
await updateUserSettings(interaction.user.id, { participating: true });
|
||||
|
||||
await interaction.createMessage({
|
||||
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 { getUser, setUserPrivacy } from "../../utils";
|
||||
import { getUser, updateUserSettings } from "../../utils";
|
||||
|
||||
// ----------
|
||||
|
||||
@SlashCommand(
|
||||
new CommandBuilder('optout', 'Opt out of the Pet the Pond event.')
|
||||
new CommandBuilder('optout', 'Stop counting your pet interactions.')
|
||||
.setIntegrationTypes(Constants.ApplicationIntegrationType.GuildInstall)
|
||||
.setContexts(Constants.InteractionContextType.Guild)
|
||||
.setCommandType(Constants.ApplicationCommandType.ChatInput)
|
||||
@@ -15,8 +15,7 @@ class OptOutCommand extends Command<CommandClient> {
|
||||
async handleCommand(context: CommandClient<any, any>, interaction: CommandInteraction) {
|
||||
await interaction.defer(true);
|
||||
|
||||
const _user = await getUser(interaction.user.id);
|
||||
await setUserPrivacy(_user.user_id, { optin: false });
|
||||
await updateUserSettings(interaction.user.id, { participating: false });
|
||||
|
||||
await interaction.createMessage({
|
||||
content: "Successfully opted out. You won't receive any points for petting :<"
|
||||
|
||||
@@ -22,7 +22,7 @@ class ProfileCommand extends Command<CommandClient> {
|
||||
await interaction.createMessage({
|
||||
embeds: [{
|
||||
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