-
Notifications
You must be signed in to change notification settings - Fork 0
Fixing the issue that users can react to old questions #62
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
base: development
Are you sure you want to change the base?
Conversation
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(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} |
There was a problem hiding this comment.
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 } |
There was a problem hiding this comment.
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
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 |
No description provided.