Skip to content
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

the bot doesnt read the question #1

Open
mark229 opened this issue Jun 20, 2023 · 4 comments
Open

the bot doesnt read the question #1

mark229 opened this issue Jun 20, 2023 · 4 comments

Comments

@mark229
Copy link

mark229 commented Jun 20, 2023

in /ask command the bot cant read your message content its always null.
but its works fine with /setup channel
image

@S7NX
Copy link
Owner

S7NX commented Jun 21, 2023

Hello, Mark

I was wondering if you could check if you're using the latest version of the code. It seems to be working fine for other users and myself. If it's not the most recent version, maybe you could update the code and give it a try.
image

@mark229
Copy link
Author

mark229 commented Jun 21, 2023

im using the latest yes. i just downloaded it i dont have old versions from your code

@S7NX
Copy link
Owner

S7NX commented Jun 22, 2023

could you show me the code of src/commands/ask.js please

@mark229
Copy link
Author

mark229 commented Jun 23, 2023

const {
Client,
Interaction,
ApplicationCommandOptionType,
PermissionFlagsBits,
EmbedBuilder,
ActionRowBuilder,
ButtonBuilder,
AttachmentBuilder,
ButtonStyle,
ComponentType,
SlashCommandBuilder,
} = require("discord.js");
const { getBardResponse } = require("../handlers/functions");
const GuildSettings = require("../models/GuildSettings");
module.exports = {
data: new SlashCommandBuilder()
.setName("ask")
.setDescription("Ask Bard.")
.addStringOption((option) =>
option
.setName("quesiton")
.setDescription("Ask Question to Bard.")
.setRequired(true)
),

async execute(client, interaction) {
try {
interaction.deferReply()
const question = interaction.options.getString("question");
let guildSettings = await GuildSettings.findOne({
guildId: interaction.guild.id,
});
if (!guildSettings) {
guildSettings = new GuildSettings({ guildId: interaction.guild.id });
guildSettings.save();
}
const answer = await getBardResponse(${question});
await interaction.editReply(answer);
} catch (e) {
console.log(e);
}
},
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants