Skip to content

Commit

Permalink
Merge pull request #61 from RileCraft/Unstable
Browse files Browse the repository at this point in the history
V8 Release
  • Loading branch information
RileCraft authored Apr 9, 2023
2 parents ee03296 + 5620c8a commit c5b6268
Show file tree
Hide file tree
Showing 81 changed files with 2,123 additions and 991 deletions.
12 changes: 12 additions & 0 deletions .github/Docs/CMDOptions/AllClientPermissions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AllClientPermissions
## Usage
```js
allClientPermissions: ["permission", "permission"]
// Example
allClientPermissions: ["Administrator", "ModerateMembers"]
```
* The client must have all the specified permissions to be able to execute the command else the error embed is sent.
## Return Error
```js
returnAllClientPermissionsError: Boolean // Default: true
```
12 changes: 12 additions & 0 deletions .github/Docs/CMDOptions/AllUserPermissions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AllUserPermissions
## Usage
```js
allUserPermissions: ["permission", "permission"]
// Example
allUserPermissions: ["Administrator", "ModerateMembers"]
```
* The user [The one who ran the command] must have all the specified permissions to be able to execute the command else the error embed is sent.
## Return Error
```js
returnAllUserPermissionsError: Boolean // Default: True
```
6 changes: 6 additions & 0 deletions .github/Docs/CMDOptions/AllowBots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# AllowBots
## Usage
```js
allowBots: Boolean // Default: false
```
* **Note:** This is only applicable to `messageCommands` and this will allow other bots to be able to run the command as well.
6 changes: 6 additions & 0 deletions .github/Docs/CMDOptions/AllowInDms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# AllowInDms
## Usage
```js
allowInDms: Boolean // Default: false
```
* **Note:** This is only applicable to `messageCommands` and this will allow the command to be able to run in the bot's direct messages [dms].
12 changes: 12 additions & 0 deletions .github/Docs/CMDOptions/AnyClientPermissions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AnyClientPermissions
## Usage
```js
anyClientPermissions: ["permission", "permission"]
// Example
anyClientPermissions: ["Administrator", "ModerateMembers"]
```
* The client must have any one of the specified permissions to be able to execute the command else the error embed is sent.
## Return Error
```js
returnAnyClientPermissionsError: Boolean // Default: true
```
12 changes: 12 additions & 0 deletions .github/Docs/CMDOptions/AnyUserPermissions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# AnyUserPermissions
## Usage
```js
anyUserPermissions: ["permission", "permission"]
// Example
anyUserPermissions: ["Administrator", "ModerateMembers"]
```
* The user [who ran the command] must have any one of the specified permissions to be able to execute the command else the error embed is sent.
## Return Error
```js
returnAnyUserPermissionsError: Boolean // Default: true
```
12 changes: 12 additions & 0 deletions .github/Docs/CMDOptions/ChannelCooldown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# ChannelCooldown
## Usage
```js
channelCooldown: Time in milliseconds
// Example
channelCooldown: 10000 // 10 Seconds cooldown
```
* The user [who ran the command] must wait until the set amount of time passes before they can run the command again. **Note:** This cooldown is a __per channel cooldown__ meaning let's say if you put a channelCooldown in channel `A` of 24hrs then the user must wait 24hrs before they can run the command again in channel `A` but they can run the command again in channel `B`.
## Return Error
```js
returnChannelCooldownError: Boolean // Default: true
```
12 changes: 12 additions & 0 deletions .github/Docs/CMDOptions/GlobalCooldown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# GlobalCooldown
## Usage
```js
globalCooldown: Time in milliseconds
// Example
globalCooldown: 10000 // 10 Seconds cooldown
```
* The user [who ran the command] must wait until the set amount of time passes before they can run the command again. **Note:** This cooldown is a __global cooldown__ meaning it applies to all the guilds.
## Return Error
```js
returnGlobalCooldownError: Boolean // Default: true
```
12 changes: 12 additions & 0 deletions .github/Docs/CMDOptions/GuildCooldown.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# GuildCooldown
## Usage
```js
guildCooldown: Time in milliseconds
// Example
guildCooldown: 10000 // 10 Seconds cooldown
```
* The user [who ran the command] must wait until the set amount of time passes before they can run the command again. **Note:** This cooldown is a __per guild cooldown__ meaning let's say if you put a guildCooldown in guild `A` of 24hrs then the user must wait 24hrs before they can run the command again in guild `A` but they can run the command again in guild `B`.
## Return Error
```js
returnGuildCooldownError: Boolean // Default: true
```
5 changes: 5 additions & 0 deletions .github/Docs/CMDOptions/Ignore.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore
* When set to `true` the command file will not be recorded.
```js
ignore: Boolean // Default: false
```
12 changes: 12 additions & 0 deletions .github/Docs/CMDOptions/OnlyChannels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OnlyChannels
## Usage
```js
onlyChannels: ["channelId", "channelId"]
// Example
onlyChannels: ["channelId", "channelId"]
```
* The command will only be able to be ran in those channels in that guild.
## Return Error
```js
returnOnlyChannelsError: Boolean // Default: true
```
12 changes: 12 additions & 0 deletions .github/Docs/CMDOptions/OnlyGuilds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OnlyGuilds
## Usage
```js
onlyGuilds: ["guildId", "guildId"]
// Example
onlyGuilds: ["guildId", "guildId"]
```
* The command will only be able to be ran in those guilds.
## Return Error
```js
returnOnlyGuildsError: Boolean // Default: true
```
12 changes: 12 additions & 0 deletions .github/Docs/CMDOptions/OnlyRoles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OnlyRoles
## Usage
```js
onlyRoles: ["roleId", "roleId"]
// Example
onlyRoles: ["roleId", "roleId"]
```
* The command will only be able to be ran by users who possess any one of those roles in that guild.
## Return Error
```js
returnOnlyRolesError: Boolean // Default: true
```
12 changes: 12 additions & 0 deletions .github/Docs/CMDOptions/OnlyUsers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OnlyUsers
## Usage
```js
onlyUsers: ["userId", "userId"]
// Example
onlyUsers: ["userId", "userId"]
```
* The command will only be able to be ran by those users in that array.
## Return Error
```js
returnOnlyUsersError: Boolean // Default: true
```w
10 changes: 10 additions & 0 deletions .github/Docs/CMDOptions/OwnerOnly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# OwnerOnly
## Usage
```js
ownerOnly: Boolean
```
* Only the users who are in the `ownerIds` array in the config file will be able to run the command.
## Return Error
```js
returnOwnerOnlyError: Boolean // Default: true
```
5 changes: 5 additions & 0 deletions .github/Docs/CMDOptions/ReturnErrors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ReturnErrors
* When set to `false` the command will not return any of the command option's error embeds.
```js
returnErrors: Boolean // Default: true
```
41 changes: 41 additions & 0 deletions .github/Docs/Managers/Buttons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Button Interaction
## Format
```js
// This format is for the button file that you will create in `Src/Interactions/Buttons`.
module.exports = {
name: "button's CustomId",
run: async(client, interaction) => {
// code
}
};
```

## Example Code
### Button Creation Code
```js
const { ButtonBuilder, ActionRowBuilder } = require("discord.js");
const row = new ActionRowBuilder()
.addComponents(
new ButtonBuilder()
.setCustomId('evalbutton')
.setLabel('Delete Output')
.setStyle('Danger'),
);
message.channel.send({
content: "This is a button",
components: [row]
});
```

### Button Code
```js
// Code for the `Src/Interactions/Buttons/EvalButton.js
module.exports = {
name: "evalbuttton",
run: async(client, interaction) => {
interaction.reply({
content: "This button is working!"
});
}
};
```
42 changes: 42 additions & 0 deletions .github/Docs/Managers/Events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Events
## Client Events
### Format
```js
module.exports = {
name: "clientEventName",
run: async(<event args>, client, rootPath) => {
// Code
}
};
```
### Example Code
```js
module.exports = {
name: "channelCreate", // Omitted whenever a channel is created in a guild.
run: async(channel, client) => {
console.log(`A new channel was created in the ${channel.guild.name} of the name ${channel.name}.`);
}
};
```

## Non-Client Events
### Format
```js
module.exports = {
customEvent: true,
run: async(client, rootPath) => {
// Code
}
};
```
### Example Code
```js
module.exports = {
customEvent: true,
run: async(client, rootPath) => {
client.Distube.on("addSong", (queue, song) => {
// Your Code
});
}
};
```
26 changes: 26 additions & 0 deletions .github/Docs/Managers/MessageCommands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# MessageCommands (With Aliases)
## Format
```js
module.exports = {
name: "commandName",
aliases: ["commandName2", "commandName3"], // Optional to be provided.
run: async(client, message, args) => {
// Code Here
}
};
```

## Example Code
```js
module.exports = {
name: "ping",
aliases: ["pong"],
run: async(client, message, args) => {
message.channel.send({
content: `My ping is ${client.ws.ping}ms.`
});
}
};

// The command can be now ran with <BotPrefix>ping or <BotPrefix>pong and it will return the ping of the bot.
```
47 changes: 47 additions & 0 deletions .github/Docs/Managers/ModalForms.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Modals
## Format
```js
// This format is for the modalForms file that you will create in `Src/Interactions/ModalForms`.
module.exports = {
name: "modalName",
run: async(client, interaction) => {
// Code
}
};
```
## Example Code
### Modal Creation Code
```js
const { ApplicationCommandType, ActionRowBuilder, ModalBuilder, TextInputBuilder, TextInputStyle } = require("discord.js");
const modal = new ModalBuilder()
.setCustomId('ExampleModal')
.setTitle('My Modal');

const favoriteColorInput = new TextInputBuilder()
.setCustomId('favoriteColorInput')
.setLabel("What's your favorite color?")
.setStyle(TextInputStyle.Short);

const hobbiesInput = new TextInputBuilder()
.setCustomId('hobbiesInput')
.setLabel("What's some of your favorite hobbies?")
.setStyle(TextInputStyle.Paragraph);

const firstActionRow = new ActionRowBuilder().addComponents(favoriteColorInput);
const secondActionRow = new ActionRowBuilder().addComponents(hobbiesInput);

modal.addComponents(firstActionRow, secondActionRow);
await interaction.showModal(modal);
```
### Modal Code
```js
// Code for the `Src/Interactions/ModalForms/ExampleModal.js
module.exports = {
name: "ExampleModal",
run: async(client, interaction) => {
interaction.reply({
content: "This modal is correctly functioning."
});
}
};
```
Loading

0 comments on commit c5b6268

Please sign in to comment.