-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from Nick-NCSU/add-guild-commands
Add guild commands
- Loading branch information
Showing
15 changed files
with
136 additions
and
83 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
token="" | ||
id="" | ||
guildid="" | ||
hypixel="" | ||
mongourl="" | ||
srcapi="" |
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
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
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,49 @@ | ||
const { EmbedBuilder } = require("discord.js"); | ||
const { SlashCommandBuilder } = require("@discordjs/builders"); | ||
|
||
/** | ||
* Function to provide a list of categories for the given game | ||
*/ | ||
module.exports = { | ||
/** | ||
* Builds /categories [string:game] | ||
*/ | ||
data: new SlashCommandBuilder() | ||
.setName("suggest") | ||
.setDescription("Create a suggestion") | ||
.addStringOption(option => | ||
option.setName("title") | ||
.setDescription("Title of the suggestion (max 256 characters).") | ||
.setRequired(true) | ||
) | ||
.addStringOption(option => | ||
option.setName("description") | ||
.setDescription("Description fo the suggestion (max 4096 characters).") | ||
.setRequired(true) | ||
), | ||
async execute(params) { | ||
const { interaction, client } = params; | ||
const channel = await client.channels.cache.get("1005944361709731981"); | ||
const title = interaction.options.get("title").value; | ||
const description = interaction.options.get("description").value; | ||
|
||
let date = new Date().toISOString().slice(0, 10); | ||
let embed = new EmbedBuilder() | ||
.setColor("#118855") | ||
.setTitle(title.slice(0, 256)) | ||
.setFooter({ text: `${date}` }) | ||
.setDescription(description.slice(0, 4096)) | ||
.addFields([ | ||
{ name: "Submitted by:", value: `<@${interaction.user.id}>`} | ||
]); | ||
let message = await channel.send({ embeds: [embed] }); | ||
message.react("👍"); | ||
message.react("👎"); | ||
message.startThread({ | ||
name: title.slice(0, 64), | ||
}); | ||
await interaction.editReply({ | ||
content: "Suggestion has been created: " + message.url | ||
}); | ||
}, | ||
}; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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