-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d3c5ec
commit da24677
Showing
22 changed files
with
799 additions
and
381 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Command from "../../internals/commandProcessor"; | ||
import discoin from "@discoin/scambio"; | ||
|
||
import auth from "../../config/auth"; | ||
|
||
const dClient = new discoin(auth.discoin.token, ["DTS"]); | ||
|
||
export default class Convert extends Command { | ||
async run(): Promise<void> { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js"; | ||
import Command from "../../internals/commandProcessor"; | ||
|
||
export default class MailboxClear extends Command { | ||
async run(): Promise<void> { | ||
const mailbox = await this.fetchMailbox(); | ||
|
||
if (mailbox.messages.length === 0) { | ||
this.interaction.reply({ | ||
embeds: [this.client.errorEmbed("Your mailbox is already empty!")], | ||
ephemeral: true, | ||
}); | ||
return; | ||
} | ||
|
||
this.interaction.reply({ | ||
embeds: [this.client.warningEmbed("Are you sure you want to do this? Your messages cannot be recovered.")], | ||
components: [ | ||
new ActionRowBuilder<ButtonBuilder>().addComponents([ | ||
new ButtonBuilder() | ||
.setCustomId("mailbox-clear-confirm") | ||
.setEmoji("👍") | ||
.setLabel("Confirm") | ||
.setStyle(ButtonStyle.Danger), | ||
]), | ||
], | ||
ephemeral: true, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { EmbedBuilder } from "discord.js"; | ||
import Command from "../../internals/commandProcessor"; | ||
|
||
export default class MailboxMessages extends Command { | ||
async run(): Promise<void> { | ||
const mailbox = await this.fetchMailbox(); | ||
|
||
const embed = new EmbedBuilder() | ||
.setColor(this.config.colors.info) | ||
.setTitle(`📬 You have ${mailbox.messages.length} messages.`); | ||
|
||
if (mailbox.messages.length === 0) {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { ActionRowBuilder } from "@discordjs/builders"; | ||
import { ModalBuilder, TextInputBuilder, TextInputStyle } from "discord.js"; | ||
import Command from "../../internals/commandProcessor"; | ||
|
||
export default class MailboxSettings extends Command { | ||
async run(): Promise<void> { | ||
const mailbox = await this.fetchMailbox(); | ||
|
||
const modal = new ModalBuilder() | ||
.setCustomId("mailbox-settings-update") | ||
.setTitle("Mailbox Settings") | ||
.addComponents([ | ||
new ActionRowBuilder<TextInputBuilder>().addComponents([ | ||
new TextInputBuilder() | ||
.setCustomId("autoreply") | ||
.setValue(mailbox.autoreply) | ||
.setLabel("Automatic Reply") | ||
.setStyle(TextInputStyle.Short) | ||
.setMinLength(0) | ||
.setRequired(true), | ||
]), | ||
new ActionRowBuilder<TextInputBuilder>().addComponents([ | ||
new TextInputBuilder() | ||
.setCustomId("active") | ||
.setValue(mailbox.receiving ? "ON" : "OFF") | ||
.setLabel("Message Receiving") | ||
.setPlaceholder("ON/OFF") | ||
.setRequired(true) | ||
.setMinLength(2) | ||
.setMaxLength(3) | ||
.setStyle(TextInputStyle.Short), | ||
]), | ||
]); | ||
|
||
this.interaction.showModal(modal); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import ComponentProcessor from "../../../internals/componentProcessor"; | ||
|
||
export default class MailboxClearConfirm extends ComponentProcessor { | ||
async run(): Promise<void> { | ||
await this.db.mailbox.update({ | ||
where: { | ||
number: this.number!.number, | ||
}, | ||
data: { | ||
messages: [], | ||
}, | ||
}); | ||
|
||
this.interaction.reply({ | ||
embeds: [{ | ||
color: this.config.colors.success, | ||
title: "📪 Cleared!", | ||
description: "Your mailbox has been cleared.", | ||
}], | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ModalBuilder, TextInputBuilder } from "@discordjs/builders"; | ||
import { ActionRowBuilder, TextInputStyle } from "discord.js"; | ||
import ComponentProcessor from "../../../internals/componentProcessor"; | ||
|
||
export default class MailboxSendInitiate extends ComponentProcessor { | ||
async run(): Promise<void> { | ||
const toSendNum = this.interaction.customId.replace("mailbox-send-initiate-", ""); | ||
|
||
const modal = new ModalBuilder() | ||
.setTitle("Send a message") | ||
.setCustomId(`mailbox-send-modal-${toSendNum}`) | ||
.addComponents([ | ||
new ActionRowBuilder<TextInputBuilder>().addComponents([ | ||
new TextInputBuilder() | ||
.setCustomId("message") | ||
.setLabel("Message") | ||
.setPlaceholder("Enter your message here") | ||
.setStyle(TextInputStyle.Short) | ||
.setRequired(true), | ||
]), | ||
]); | ||
|
||
this.interaction.showModal(modal); | ||
} | ||
} |
Oops, something went wrong.