Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/commands/tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class TagCommand extends Command {
.setRequired(true)
.addChoices(
// Keep existing choices
{ name: 'AI', value: 'ai' },
{ name: 'ask', value: 'ask' },
{ name: 'avrdude', value: 'avrdude' },
{ name: 'codeblock', value: 'codeblock' },
Expand Down Expand Up @@ -55,6 +56,29 @@ export class TagCommand extends Command {
const tagName = interaction.options.getString('name', true) as keyof typeof tags;
const user = interaction.options.getUser('user');
const tag = tags[tagName];
const botCommandsOnly = tag.botCommandsOnly !== false; // Defaults to true if missing

// // Role restriction check
// if (tag.requiredRoles) {
// const member = await interaction.guild?.members.fetch(interaction.user.id);
// const hasRole = member?.roles.cache.some(role =>
// tag.requiredRoles.includes(role.name) || tag.requiredRoles.includes(role.id)
// );
// if (!hasRole) {
// return interaction.reply({
// content: "You do not have permission to use this tag.",
// ephemeral: true,
// });
// }
// }

if (!botCommandsOnly) {
if (typeof tag === "object" && tag.content) {
return interaction.reply({ content: tag.content, ephemeral: false });
} else if (typeof tag === "string") {
return interaction.reply({ content: tag, ephemeral: false });
}
}

if (!tag) {
return interaction.reply({ content: 'That tag does not exist.', ephemeral: true });
Expand Down
24 changes: 21 additions & 3 deletions src/utils/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ import { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "disc
import universalEmbed from "../index";

export default {
ai: {
embeds: [
new EmbedBuilder(universalEmbed)
.setImage("https://static.vecteezy.com/system/resources/previews/025/435/769/non_2x/do-not-use-ai-tools-artificial-intelegent-is-not-allowed-anti-ai-sign-no-ai-generated-content-protest-against-ai-illustration-university-school-rule-vector.jpg")
.setTitle("🚫 NO AI ZONE 🚫")
.setDescription("This server is a **NO AI** zone. We do not allow the use of AI-generated content, including but not limited to ChatGPT, Midjourney, DALL-E, and other similar tools. This includes asking for help with code, schematics, or any other content that can be generated by AI.\n\nWe believe in the value of human creativity and problem-solving skills. We encourage you to learn and grow by engaging with the community and seeking help from fellow members.\n\nIf you have questions or need assistance, please ask the community for help. We're here to support each other and learn together! \n\nThank you for respecting this rule and helping to maintain the integrity of our community by NOT useing ai to reply to users, and if users are useing AI for there project, do not assist!")
.setFooter({
text: "Help us keep this a NO AI zone!\n\nYou do them no favors by using AI, as it will stunt there growth and learning.",
}
),
],
},
ask: {
embeds: [
new EmbedBuilder(universalEmbed)
Expand Down Expand Up @@ -112,6 +124,7 @@ export default {

codeblock: {
content: "```ino\n// Please right-click on this message (long-press on mobile)\n// then select \"Copy Text.\"\n\n// After that, copy your code; then paste it in place of this comment\n```",
botCommandsOnly: false,
},

debounce: {
Expand Down Expand Up @@ -199,7 +212,7 @@ export default {
},
{
name: "6. Have you tried holding down the BOOT/IO0/FLASH button?",
value: "Try holding down the BOOT/IO0/FLASH button before uploading."
value: "Unhook the board, wait 10 secconds, then try holding down the BOOT/IO0/FLASH button. Keep holding it down untill **AFTER** its done compileing, and the IDE says \"uploading\".\n\nThen release the button. This puts the board into flash mode, and can sometimes help with communication issues.\n\nThe boards are so bad sometimes the buttons are labeled backwords, so try again with the other button if it has one."
},
{
name: "7. Are there any problems with your wiring?",
Expand Down Expand Up @@ -259,7 +272,7 @@ export default {
.addFields(
{
name: "The Problem: Voltage Mismatch",
value: "Many popular Arduino boards, like the Uno and Mega operate at **5 Volts (5V)**. This means their digital pins operate at 5V for a 'HIGH' signal, and they expect 5v in return **3.3v will not be reconized**.\n\nHowever, a lot of modern modules and sensors (like the NRF24L01, ESP8266, SD cards) are designed to operate at **3.3 Volts (3.3V)**. Their input pins are often **NOT 5V tolerant** and they can NOT repibably send 5v devices either. https://wiki.arduinodiscord.cc/hardwareGuides/logiclevel"
value: "Many popular Arduino boards, like the Uno and Mega operate at **5 Volts (5V)**. This means their digital pins operate at 5V for a 'HIGH' signal, and they expect 5v in return **3.3v will not be reconized**.\n\nHowever, a lot of modern modules and sensors (like the NRF24L01, ESP8266, SD cards) are designed to operate at **3.3 Volts (3.3V)**. Their input pins are often **NOT 5V tolerant** and they can NOT repibably send 5v devices either.\n\n Its like some one whispering softly to someone that is hard of hearing. They can not commonunicate consistantly. https://wiki.arduinodiscord.cc/hardwareGuides/logiclevel"
},
{
name: "What Happens if You Connect 5V to a 3.3V Pin?",
Expand Down Expand Up @@ -353,7 +366,7 @@ export default {
},
{
name: "3. Powering the Arduino properly",
value: "On most Arduino boards, there will be a pin marked **VIN**. This stands for Voltage Input. You can provide the maximum power rating for your board on this pin. An UNO will accept 7-12V. If you have a regulated 5-volt power supply, you can sometimes use the 5V pin to power the Arduino. You should **NOT** connect batteries to the 5V or 3.3V pins. You can also power Arduinos via USB plugs or the barrel jack on some boards."
value: "On most Arduino boards, there will be a pin marked **VIN**. This stands for Voltage Input. You can provide the maximum power rating for your board on this pin. An UNO will accept 7-12V. The voltage reagulator requires around 2v above what is trying to be supplied out. 5v plus 2v for the overhead = 7v+. Also the more voltage you supply to this pin, the less current you can get out of the board. Example: 7v you can get 400ma out of the reagulator. 12v you can get 100ma. 24v might over heat the reagulator useing just the board its self. If you have a regulated 5-volt power supply, you can sometimes use the 5V pin to power the Arduino. You should **NOT** connect batteries to the 5V or 3.3V pins. You can also power Arduinos via USB, this is conected directly to the 5v PIN on the board, or the barrel jack, that is conected directly to the VIN pin on some boards."

},
{
Expand Down Expand Up @@ -411,6 +424,11 @@ export default {
}
),
],
// },
// restrictedtag: {
// content: "This is a restricted tag.",
// requiredRoles: ['Admin', 'Moderator'], // Role names or IDs
// },
}
};