Update messages

This commit is contained in:
Oliver-Akins 2021-12-02 16:31:58 -06:00
parent c919cecd2e
commit ebe49c2988

View file

@ -23,9 +23,11 @@ const NEXT_COMMAND = (ctx: msg_data, args: string[]): string => {
.filter(x => x == questions[question_index])
.length;
let correct_users: string[] = [];
for (var user in users) {
let delta = 0;
if (users[user] == questions[question_index]) {
correct_users.push(user);
delta = 1;
};
@ -38,6 +40,16 @@ const NEXT_COMMAND = (ctx: msg_data, args: string[]): string => {
reset_users();
axios.post(
`https://ptb.discord.com/api/webhooks/916068083863539782/9k2b66SUIeY8hl5id7gdnZF6Abc8Fb1f5-RVlgbUJqirNmALkrrgrCWdsufcZ5Bn2a4i`,
{
content: `Users who got question ${question_index + 1} right:
\`\`\`csv
${correct_users.join(", ")}
\`\`\``
}
)
// Check if questions has run dry
if (question_index == questions.length) {
@ -45,7 +57,7 @@ const NEXT_COMMAND = (ctx: msg_data, args: string[]): string => {
axios.post(
`https://ptb.discord.com/api/webhooks/916068083863539782/9k2b66SUIeY8hl5id7gdnZF6Abc8Fb1f5-RVlgbUJqirNmALkrrgrCWdsufcZ5Bn2a4i`,
{
content: `\`\`\`json\n${JSON.stringify(users, null, "\t")}\n\`\`\`\n\n\n\`\`\`${user_right_count}`
content: `\`\`\`json\n${JSON.stringify(user_right_count, null, "\t")}\`\`\``
}
);