@ -1,3 +1,4 @@
import { getCommandMentionByName } from './../utils/getCommandMentionByName.js' ;
import { LoadingEmbed } from "../utils/defaults.js" ;
import Discord , {
ActionRowBuilder ,
@ -18,32 +19,43 @@ import { Embed } from "../utils/defaults.js";
export default async ( guild : Guild , interaction? : CommandInteraction ) = > {
let c : GuildTextBasedChannel | null = guild . publicUpdatesChannel ? guild.publicUpdatesChannel : guild.systemChannel ;
c = c
? c
: ( guild . channels . cache . find (
( ch ) = >
[
ChannelType . GuildText ,
ChannelType . GuildAnnouncement ,
ChannelType . PublicThread ,
ChannelType . PrivateThread ,
ChannelType . AnnouncementThread
] . includes ( ch . type ) &&
ch . permissionsFor ( guild . roles . everyone ) . has ( "SendMessages" ) &&
ch . permissionsFor ( guild . members . me ! ) . has ( "EmbedLinks" )
) as GuildTextBasedChannel | undefined ) ? ? null ;
? c
: ( guild . channels . cache . find (
( ch ) = >
[
ChannelType . GuildText ,
ChannelType . GuildAnnouncement ,
ChannelType . PublicThread ,
ChannelType . PrivateThread ,
ChannelType . AnnouncementThread
] . includes ( ch . type ) &&
ch . permissionsFor ( guild . roles . everyone ) . has ( "SendMessages" ) &&
ch . permissionsFor ( guild . members . me ! ) . has ( "EmbedLinks" )
) as GuildTextBasedChannel | undefined ) ? ? null ;
if ( interaction ) c = interaction . channel as GuildTextBasedChannel ;
if ( ! c ) {
return ;
}
let m : Message ;
if ( interaction ) {
m = ( await interaction . reply ( {
embeds : LoadingEmbed ,
fetchReply : true ,
ephemeral : true
} ) ) as Message ;
} else {
m = await c . send ( { embeds : LoadingEmbed } ) ;
}
let page = 0 ;
const pages = [
new Embed ( )
. setEmbed (
new EmojiEmbed ( )
. setTitle ( "Welcome to Nucleus" )
. setDescription (
"Thanks for adding Nucleus to your server\n\n" +
"On the next few pages you can find instructions on getting started, and commands you may want to set up\n\n" +
"If you need support, have questions or want features, you can let us know in [Clicks](https://discord.gg/bPaNnxe)"
"Thanks for adding Nucleus to your server ! \n\n" +
" The next few pages will show what features Nucleus has to offer, and how to enable them. \n\n" +
"If you need support, have questions or want features, you can let us know in [Clicks](https://discord.gg/bPaNnxe) ! "
)
. setEmoji ( "NUCLEUS.LOGO" )
. setStatus ( "Danger" )
@ -54,15 +66,17 @@ export default async (guild: Guild, interaction?: CommandInteraction) => {
new Embed ( )
. setEmbed (
new EmojiEmbed ( )
. setTitle ( "Log ging ")
. setTitle ( "Log s ")
. setDescription (
"Nucleus can log server events and keep you informed with what content is being posted to your server.\n" +
"We have 2 different types of logs, which each can be configured to send to a channel of your choice:\n" +
"**General Logs:** These are events like kicks and channel changes etc.\n" +
"**Warning Logs:** Warnings like NSFW avatars and spam etc. that may require action by a server staff member. " +
"These go to to a separate staff notifications channel.\n\n" +
"A general log channel can be set with `/settings log`\n" +
"A warning log channel can be set with `/settings warnings channel`"
"**General:** These are events like kicks and channel changes etc.\n" +
` > These are standard logs and can be set with ${ await getCommandMentionByName ( "settings/logs/general" ) } \ n ` +
"**Warnings:** Warnings like NSFW avatars and spam etc. that may require action by a server staff member.\n" +
` > These may require special action by a moderator. You can set the channel with ${ await getCommandMentionByName ( "settings/logs/warnings" ) } \ n ` + // TODO
"**Attachments:** All images sent in the server - Used to keep a record of deleted images\n" +
` > Sent to a separate log channel to avoid spam. This can be set with ${ await getCommandMentionByName ( "settings/logs/attachments" ) } \ n ` +
` > ${ getEmojiByName ( "NUCLEUS.PREMIUM" ) } Please note this feature is only available with ${ await getCommandMentionByName ( "nucleus/premium" ) } `
)
. setEmoji ( "ICONS.LOGGING" )
. setStatus ( "Danger" )
@ -76,27 +90,15 @@ export default async (guild: Guild, interaction?: CommandInteraction) => {
. setTitle ( "Moderation" )
. setDescription (
"Nucleus has a number of commands that can be used to moderate your server.\n" +
"These commands are all found under `/mod`, and they include:\n" +
` ** ${ getEmojiByName (
"PUNISH.WARN.YELLOW"
) } Warn : * * The user is warned ( via DM ) that they violated server rules . \ n ` +
` ** ${ getEmojiByName (
"PUNISH.CLEARHISTORY"
) } Clear : * * Some messages from a user are deleted in a channel . \ n ` +
` ** ${ getEmojiByName (
"PUNISH.MUTE.YELLOW"
) } Mute : * * The user is unable to send messages or join voice chats . \ n ` +
` ** ${ getEmojiByName (
"PUNISH.MUTE.GREEN"
) } Unmute : * * The user is able to send messages in the server . \ n ` +
` ** ${ getEmojiByName ( "PUNISH.KICK.RED" ) } Kick:** The user is removed from the server. \ n ` +
` ** ${ getEmojiByName (
"PUNISH.SOFTBAN"
) } Softban : * * Kicks the user , deleting their messages from every channel . \ n ` +
` ** ${ getEmojiByName (
"PUNISH.BAN.RED"
) } Ban : * * The user is removed from the server , and they are unable to rejoin . \ n ` +
` ** ${ getEmojiByName ( "PUNISH.BAN.GREEN" ) } Unban:** The user is able to rejoin the server. `
` These commands are all found under ${ await getCommandMentionByName ( ( "mod" ) ) } , and they include: \ n ` +
` ${ getEmojiByName ( "PUNISH.WARN.YELLOW" ) } ${ await getCommandMentionByName ( "mod/warn" ) } : The user is warned (via DM) that they violated server rules. More options given if DMs are disabled. \ n ` +
` ${ getEmojiByName ( "PUNISH.CLEARHISTORY" ) } ${ await getCommandMentionByName ( "mod/purge" ) } : Deletes messages in a channel, giving options to only delete messages by a certain user. \ n ` +
` ${ getEmojiByName ( "PUNISH.MUTE.YELLOW" ) } ${ await getCommandMentionByName ( "mod/mute" ) } : Stops users sending messages or joining voice chats. \ n ` +
` ${ getEmojiByName ( "PUNISH.MUTE.GREEN" ) } ${ await getCommandMentionByName ( "mod/unmute" ) } : Allows user to send messages and join voice chats. \ n ` +
` ${ getEmojiByName ( "PUNISH.KICK.RED" ) } ${ await getCommandMentionByName ( "mod/kick" ) } : Removes a member from the server. They will be able to rejoin. \ n ` +
` ${ getEmojiByName ( "PUNISH.SOFTBAN" ) } ${ await getCommandMentionByName ( "mod/softban" ) } : Kicks the user, deleting their messages from every channel in a given time frame. \ n ` +
` ${ getEmojiByName ( "PUNISH.BAN.RED" ) } ${ await getCommandMentionByName ( "mod/ban" ) } : Removes the user from the server, deleting messages from every channel and stops them from rejoining. \ n ` +
` ${ getEmojiByName ( "PUNISH.BAN.GREEN" ) } ${ await getCommandMentionByName ( "mod/unban" ) } : Allows a member to rejoin the server after being banned. `
)
. setEmoji ( "PUNISH.BAN.RED" )
. setStatus ( "Danger" )
@ -110,9 +112,9 @@ export default async (guild: Guild, interaction?: CommandInteraction) => {
. setTitle ( "Verify" )
. setDescription (
"Nucleus has a verification system that allows users to prove they aren't bots.\n" +
"This is done by running `/verify` which sends a message only the user can see, giving them a link to a CAPTCHA to verify.\n" +
"After the user complete's the CAPTCHA, they are given a role and can use the permissions accordingly .\n" +
"You can set the role given with `/settings verify`"
` This is done by running ${ await getCommandMentionByName ( "verify" ) } which sends a message only the user can see, giving them a link to a website to verify. \ n ` +
"After the user complete's the check, they are given a role, which can be set to unlock specific channels .\n" +
` You can set the role given with ${ await getCommandMentionByName ( "settings/verify" ) } `
)
. setEmoji ( "CONTROL.REDTICK" )
. setStatus ( "Danger" )
@ -126,8 +128,8 @@ export default async (guild: Guild, interaction?: CommandInteraction) => {
. setTitle ( "Content Scanning" )
. setDescription (
"Nucleus has a content scanning system that automatically scans links and images sent by users.\n" +
" Nucleus can detect, delete, and punish users for sending NSFW content, or links to scam or adult sites .\n" +
"You can set the threshold for this in `/settings automation`" // TODO
" The staff team can be notified when an NSFW image is detected, or malicious links are sent .\n" +
` You can check and manage what to moderate in ${ await getCommandMentionByName ( "settings/filters" ) } `
)
. setEmoji ( "MOD.IMAGES.TOOSMALL" )
. setStatus ( "Danger" )
@ -140,10 +142,12 @@ export default async (guild: Guild, interaction?: CommandInteraction) => {
new EmojiEmbed ( )
. setTitle ( "Tickets" )
. setDescription (
"Nucleus has a ticket system that allows users to create tickets and have a support team respond to them.\n" +
"Tickets can be created with `/ticket create` and a channel is created, pinging the user and support role.\n" +
"When the ticket is resolved, anyone can run `/ticket close` (or click the button) to close it.\n" +
"Running `/ticket close` again will delete the ticket."
"Nucleus has a ticket system which allows users to create tickets and talk to the server staff or support team.\n" +
` Tickets can be created by users with ${ await getCommandMentionByName ( "ticket/create" ) } , or by clicking a button created by moderators. \ n ` +
` After being created, a new channel or thread is created, and the user and support team are pinged. \ n ` +
` The category or channel to create threads in can be set with ${ await getCommandMentionByName ( "settings/tickets" ) } \ n ` +
` When the ticket is resolved, anyone can run ${ await getCommandMentionByName ( "ticket/close" ) } (or click the button) to close it. \ n ` +
` Running ${ await getCommandMentionByName ( "ticket/close" ) } again will delete the ticket. `
)
. setEmoji ( "GUILD.TICKET.CLOSE" )
. setStatus ( "Danger" )
@ -156,11 +160,10 @@ export default async (guild: Guild, interaction?: CommandInteraction) => {
new EmojiEmbed ( )
. setTitle ( "Tags" )
. setDescription (
"Add a tag system to your server with the `/tag` and `/tags` commands.\n" +
"To create a tag, type `/tags create <tag name> <tag content>`.\n" +
"Tag names and content can be edited with `/tags edit`.\n" +
"To delete a tag, type `/tags delete <tag name>`.\n" +
"To view all tags, type `/tags list`.\n"
"Nucleus allows you to create tags, which allow a message to be sent when a specific tag is typed.\n" +
` Tags can be created with ${ await getCommandMentionByName ( "tags/create" ) } , and can be edited with ${ await getCommandMentionByName ( "tags/edit" ) } \ n ` +
` Tags can be deleted with ${ await getCommandMentionByName ( "tags/delete" ) } , and can be listed with ${ await getCommandMentionByName ( "tags/list" ) } \ n ` +
` To use a tag, you can type ${ await getCommandMentionByName ( "tag" ) } , followed by the tag to send `
)
. setEmoji ( "PUNISH.NICKNAME.RED" )
. setStatus ( "Danger" )
@ -173,10 +176,10 @@ export default async (guild: Guild, interaction?: CommandInteraction) => {
new EmojiEmbed ( )
. setTitle ( "Premium" )
. setDescription (
" In the near future, we will be releasing extra premium only features .\n" +
"These features will include:\n \n" +
"**Attachment logs**\n> When a message with attachments is edited or deleted, the logs will also include the images sent. \n" +
"\nPremium is not yet available. Check `/nucleus premium` for updates on features and pricing"
" Nucleus Premium allows you to use extra features in your server, which are useful but not essential .\n" +
"**No currently free commands will become premium features.** \n" +
"Premium features include creating ticket transcripts and attachment logs.\n \n" +
"Premium can be purchased in [our server](https://discord.gg/bPaNnxe) in the subscriptions page" // TODO: add a table graphic
)
. setEmoji ( "NUCLEUS.PREMIUM" )
. setStatus ( "Danger" )
@ -185,17 +188,6 @@ export default async (guild: Guild, interaction?: CommandInteraction) => {
. setDescription ( "Premium features" )
. setPageId ( 7 )
] ;
let m : Message ;
if ( interaction ) {
m = ( await interaction . reply ( {
embeds : LoadingEmbed ,
fetchReply : true ,
ephemeral : true
} ) ) as Message ;
} else {
m = await c . send ( { embeds : LoadingEmbed } ) ;
}
let page = 0 ;
const publicFilter = async ( component : MessageComponentInteraction ) = > {
return ( component . member as Discord . GuildMember ) . permissions . has ( "ManageGuild" ) ;