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

Fixing the issue that users can react to old questions #62

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

KoTenshi
Copy link
Contributor

@KoTenshi KoTenshi commented Oct 6, 2023

No description provided.

@KoTenshi KoTenshi linked an issue Oct 6, 2023 that may be closed by this pull request
@KoTenshi KoTenshi requested a review from johan-t October 6, 2023 17:56
@@ -108,7 +110,7 @@ export const sendTestButton = async () => {
const guild: Guild | undefined = client.guilds.cache.get(guildId);
if (!guild) throw new Error('Guild not found');

(guild.channels.cache.get("1135557183845711983") as TextChannel).send({ components: [actionRow] }); // Channel Id for #How-to-basics
(guild.channels.cache.get("1135557183845711983") as TextChannel).send({ components: [actionRow] }); // Channel Id for #How-to-basics; main sever: 1135557183845711983; test sever: 1159905209414332526
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(guild.channels.cache.get("1135557183845711983") as TextChannel).send({ components: [actionRow] }); // Channel Id for #How-to-basics; main sever: 1135557183845711983; test sever: 1159905209414332526
(guild.channels.cache.get("1135557183845711983") as TextChannel).send({ components: [actionRow] }); // Channel Id for #How-to-basics; main server: 1135557183845711983; test server: 1159905209414332526

@@ -44,6 +44,8 @@ const questions = [
{ question: 'Unternehmen sollen selbst entscheiden, ob sie ihren Beschäftigten das Arbeiten im Homeoffice erlauben.', tag: ['Arbeitsrecht', 'Digitalisierung'] },
];

const specificQuestionMessage = {} as { [key: string]: any}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this object is only stored in heap. therefore, it'd reset every time the bot re-deploys

@@ -417,3 +423,4 @@ export const execute = async (interaction: any) => {
sendQuestion(interaction);
};

export { specificQuestionMessage }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btw use individual exports instead of putting all exports at the end of the file

@greg6775
Copy link
Member

greg6775 commented Oct 6, 2023

interesting approach. however, we could just keep editing the bot's initial message and then hide the buttons after the last question has been answered

this way we could solve this issue and also prevent the dm history from being so cluttered

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

Successfully merging this pull request may close these issues.

Make it impossible to react to old question
2 participants