Skip to content

Commit

Permalink
Removed 4 packages
Browse files Browse the repository at this point in the history
- Replaced figlet and sourcebin_js with a local version
- Updated many pacakges to their latest
- Fixed all GuildCreate events
- Fixed guild logs
- Switched twemoji package
- Updated slash commands descriptions
  • Loading branch information
Prince527GitHub committed Jan 27, 2024
1 parent 1b9316c commit bd2093b
Show file tree
Hide file tree
Showing 29 changed files with 1,892 additions and 446 deletions.
13 changes: 3 additions & 10 deletions SlashCommands/context/Ascii.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { Client, CommandInteraction, ApplicationCommandType } = require("discord.js");
const figlet = require("figlet");
const { stringToAscii } = require("../../assets/api/ascii");

module.exports = {
name: "Ascii",
Expand All @@ -13,15 +13,8 @@ module.exports = {
run: async (client, interaction, args) => {
const msg = await interaction.channel.messages.fetch(interaction.targetId);

figlet.text(
`${msg.content}`,
{
font: "Standard"
},
async (err, data) => {
interaction.followUp({ content: `\`\`\`${data.slice(0, 1975)}\`\`\`` });
}
);
const ascii = stringToAscii(msg.content);

interaction.followUp({ content: `\`\`\`${ascii.slice(0, 1975)}\`\`\`` });
},
};
2 changes: 1 addition & 1 deletion SlashCommands/extra/anime.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
options: [
{
name: 'category',
description: "which action do you want",
description: "Specify the action you want to perform.",
required: true,
type: ApplicationCommandOptionType.String,
choices: [
Expand Down
109 changes: 69 additions & 40 deletions SlashCommands/extra/codebin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { Client, CommandInteraction, EmbedBuilder, ApplicationCommandType, ApplicationCommandOptionType } = require("discord.js");
const sourcebin = require("sourcebin_js");
const languages = require("../../assets/api/sourcebin/languages.json");

module.exports = {
name: "codebin",
Expand All @@ -8,56 +8,56 @@ module.exports = {
options: [{
type: ApplicationCommandOptionType.String,
name: "title",
description: "What is the name of the source?",
description: "Enter the name of the source.",
required: true
},
{
type: ApplicationCommandOptionType.String,
name: "language",
description: "What is the language in the source?",
description: "Specify the language used in the source.",
required: true,
choices: [{
name: "None",
value: "NONE"
value: "text"
},
{
name: "JavaScript",
value: "JavaScript"
value: "javascript"
},
{
name: "HTML",
value: "HTML"
value: "html"
},
{
name: "Python",
value: "Python"
value: "python"
},
{
name: "Java",
value: "Java"
value: "java"
},
{
name: "CSS",
value: "CSS"
value: "css"
},
{
name: "SVG",
value: "SVG"
value: "svg"
},
{
name: "C#",
value: "C#"
value: "c#"
},
{
name: "XML",
value: "XML"
value: "xml"
}
]
},
{
type: ApplicationCommandOptionType.String,
name: "code",
description: "What's the source?",
description: "Provide the source code or text to be stored and shared.",
required: true
}
],
Expand All @@ -73,33 +73,62 @@ module.exports = {
const content = interaction.options.getString("code");
const title = interaction.options.getString("title");

sourcebin
.create(
[{
name: `Made By ${interaction.user.username}`,
content: content,
languageId: language
}], {
title: title
}
)
.then((src) => {
interaction.followUp({
content: src.url,
embeds: [
new EmbedBuilder()
.setTitle("Sourcebin")
.setColor("Random")
.setDescription(`Code:\n\`\`\`js\n${Content}\n\`\`\``)
],
ephemeral: true
});
})
.catch((e) => {
interaction.followUp({
content: "Error, try again later",
ephemeral: true
});
try {
const codebin = await (await fetch("https://sourceb.in/api/bins", {
method: "POST",
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
title: `Made By ${interaction.user.username}`,
description: "",
files: [
{
languageId: languages[language],
name: title,
content,
}
]
})
})).json();

interaction.followUp({
content: `https://sourceb.in/${codebin.key}`,
embeds: [
new EmbedBuilder()
.setTitle("Sourcebin")
.setColor("Random")
.setDescription(`Code:\n\`\`\`js\n${content}\n\`\`\``)
],
ephemeral: true
});
} catch(err) {
console.log(err)

interaction.followUp({
content: "Error, try again later",
ephemeral: true
});
}

// sourcebin
// .create(
// [{
// name: `Made By ${interaction.user.username}`,
// content: content,
// languageId: language
// }], {
// title: title
// }
// )
// .then((src) => {

// })
// .catch((e) => {
// interaction.followUp({
// content: "Error, try again later",
// ephemeral: true
// });
// });
},
};
2 changes: 1 addition & 1 deletion SlashCommands/game/tictactoe.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
options: [
{
name: 'opponent',
description: 'Who you want to play with',
description: 'Specify who you want to play with.',
type: ApplicationCommandOptionType.User,
required: true
}
Expand Down
2 changes: 1 addition & 1 deletion SlashCommands/music/loop.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
options: [{
name: "mode",
type: ApplicationCommandOptionType.Integer,
description: "Loop type",
description: "Select the loop mode.",
required: true,
choices: [{
name: "Off",
Expand Down
2 changes: 1 addition & 1 deletion SlashCommands/music/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
options: [
{
name: "songtitle",
description: "title of the song",
description: "Title of the song.",
type: ApplicationCommandOptionType.String,
required: true,
}
Expand Down
2 changes: 1 addition & 1 deletion SlashCommands/music/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
type: ApplicationCommandType.ChatInput,
options: [{
name: "page",
description: "the page of the queue to display",
description: "The page of the queue to display.",
type: ApplicationCommandOptionType.Integer,
required: false,
}],
Expand Down
2 changes: 1 addition & 1 deletion SlashCommands/music/shuffle.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
type: ApplicationCommandType.ChatInput,
options: [{
name: "mode",
description: "Shuffle type",
description: "Specify the shuffle mode.",
type: ApplicationCommandOptionType.Boolean,
required: true
}],
Expand Down
2 changes: 1 addition & 1 deletion SlashCommands/music/volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
type: ApplicationCommandType.ChatInput,
options: [{
name: "percentage",
description: "percentage to change the volume to",
description: "Specify the percentage to which you want to change the volume.",
type: ApplicationCommandOptionType.Integer,
required: false,
}],
Expand Down
10 changes: 5 additions & 5 deletions SlashCommands/utils/customCommands.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ module.exports = {
options: [
{
name: "create",
description: "create a custom command",
description: "Create a custom command.",
type: ApplicationCommandOptionType.Subcommand,
options: [
{
name: "command",
description: "name of the custom command",
description: "Specify the name of the custom command.",
type: ApplicationCommandOptionType.String,
required: true
},
{
name: "response",
description: "response for this custom command",
description: "Provide the response for this custom command.",
type: ApplicationCommandOptionType.String,
required: true
},
],
},
{
name: "delete",
description: "remove a custom command",
description: "Remove a custom command.",
type: ApplicationCommandOptionType.Subcommand,
options: [
{
name: "command",
description: "name of the custom command",
description: "Specify the name of the custom command to be removed.",
type: ApplicationCommandOptionType.String,
required: true
},
Expand Down
24 changes: 12 additions & 12 deletions SlashCommands/utils/poll.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,73 +8,73 @@ module.exports = {
options: [
{
name: 'title',
description: 'The title of poll',
description: 'The title of the poll.',
type: ApplicationCommandOptionType.String,
required: true,
},
{
name: 'choice1',
description: 'A choice',
description: 'Choices for the poll.',
type: ApplicationCommandOptionType.String,
required: true,
},
{
name: 'choice2',
description: 'A choice',
description: 'Choices for the poll.',
type: ApplicationCommandOptionType.String,
required: true,
},
{
name: 'choice3',
description: 'A choice',
description: 'Choices for the poll.',
type: ApplicationCommandOptionType.String,
required: false,
},
{
name: 'choice4',
description: 'A choice',
description: 'Choices for the poll.',
type: ApplicationCommandOptionType.String,
required: false,
},
{
name: 'choice5',
description: 'A choice',
description: 'Choices for the poll.',
type: ApplicationCommandOptionType.String,
required: false,
},
{
name: 'choice6',
description: 'A choice',
description: 'Choices for the poll.',
type: ApplicationCommandOptionType.String,
required: false,
},
{
name: 'choice7',
description: 'A choice',
description: 'Choices for the poll.',
type: ApplicationCommandOptionType.String,
required: false,
},
{
name: 'choice8',
description: 'A choice',
description: 'Choices for the poll.',
type: ApplicationCommandOptionType.String,
required: false,
},
{
name: 'choice9',
description: 'A choice',
description: 'Choices for the poll.',
type: ApplicationCommandOptionType.String,
required: false,
},
{
name: 'choice10',
description: 'A choice',
description: 'Choices for the poll.',
type: ApplicationCommandOptionType.String,
required: false,
},
{
name: 'destination',
description: 'The channel for the poll',
description: 'The channel where the poll will be created.',
type: ApplicationCommandOptionType.Channel,
required: false,
channelTypes: [ChannelType.GuildText],
Expand Down
Loading

0 comments on commit bd2093b

Please sign in to comment.