-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
say command? #354
Open
DarthMayTriX
wants to merge
351
commits into
v4
Choose a base branch
from
main
base: v4
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
say command? #354
Conversation
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
TypeError: Cannot read properties of null (reading 'toUpperCase') at antiMassMention (/usr/src/app/src/commands/admin/automod/anti.js:172:24)
DiscordAPIError[50035]: Invalid Form Body user_id[NUMBER_TYPE_COERCE]: Value "w" is not snowflake.
DiscordAPIError[50001]: Missing Access
TypeError: Cannot read properties of null (reading 'has') at shouldModerate (/usr/src/app/src/handlers/automod.js:28:48)
Error [FetchOwnerId]: Couldn't resolve the guild ownerId to fetch the member.
DiscordAPIError[50013]: Missing Permissions
TypeError: this.safeSend is not a function
RangeError: Invalid time value
TypeError: req.client.wait is not a function
V5 bug fixes
V5.0.1 release
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-GOT-2932019
strange api key validation
227 new image api
Fix /help: Cannot read properties of undefined (reading 'find')
Fix "Unknown Interaction" error when start a giveaway
…93e8c2d9ae450b2f9a6 [Snyk] Upgrade mongoose from 7.3.4 to 7.4.0
fix duplicate ranks
Update image API base url
fixed rank card
Fix subcommands not loading in /help embed
Fix contexts count always 0
Fix /search bug: select menu options must be >= 1
Fix move command "No matching channels found"
5.5.0 Release
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
const {
EmbedBuilder,
ApplicationCommandOptionType,
ActionRowBuilder,
ButtonBuilder,
ButtonStyle,
ComponentType,
} = require("discord.js");
module.exports = {
name: "say",
description: "Says a message as the bot to a channel you choose",
category: "ADMIN",
botPermissions: ["SendMessages"],
userPermissions: ["ManageMessages"],
slashCommand: {
enabled: true,
ephemeral: true,
description: "Says a message as the bot to a channel you choose",
options: [
{
name: "message",
description: "The message to be sent.",
type: 3,
required: true,
},
{
name: "channel",
description: "The channel where the message will be sent.",
type: 7,
required: false,
},
{
name: "message_id",
description: "The ID of the message to edit or reply to.",
type: 3,
required: false,
},
{
name: "edit",
description: "Whether to edit the message specified by message_id instead of sending a new message.",
type: 5,
required: false,
},
{
name: "ping",
description: "Whether to ping everyone in the channel after sending the message.",
type: 5,
required: false,
},
],
},
async execute(interaction) {
const { options } = interaction;
// Retrieve the message content
const message = options.getString("message").replace(/\n/g, '\n');
// Retrieve the channel where the message will be sent
const channel = options.getChannel("channel") || interaction.channel;
// Retrieve the message ID to edit or reply to
const message_id = options.getString("message_id");
// Retrieve whether to edit the message specified by message_id
const edit = options.getBoolean("edit");
// Retrieve whether to ping everyone in the channel after sending the message
const ping = options.getBoolean("ping");
try {
// If a message ID is provided, retrieve the message and edit or reply to it
if (message_id) {
const replyMessage = await channel.messages.fetch(message_id).catch(() => null);
if (taggedChannel) {
await taggedChannel.send({ content: message, allowedMentions: { parse: ["everyone", "roles", "users"] } });
if (ping) {
setTimeout(async () => {
await taggedChannel.send({ content: "@everyone", allowedMentions: { parse: ["everyone", "roles", "users"] } });
}, 2000); // wait 2 seconds before sending the second message
}
} else {
await interaction.channel.send({ content: message, allowedMentions: { parse: ["everyone", "roles", "users"] } });
if (ping) {
setTimeout(async () => {
await interaction.channel.send({ content: "@everyone", allowedMentions: { parse: ["everyone", "roles", "users"] } });
}, 2000); // wait 2 seconds before sending the second message
}
}
} catch (error) {
console.error(error);
await interaction.followUp({ content: "An error occurred while processing this command.", ephemeral: true });
}
},
async messageRun(message, args, data) {
const replyEmbed = new EmbedBuilder()
.setTitle("Command Deprecated")
.setDescription("Please use the slash command instead.\n\nUsage: /say [channel] [message_id] [edit] [ping]");
return message.reply({ embeds: [replyEmbed], ephemeral: true });
},
async interactionRun(interaction) {
await this.execute(interaction);
},
};