Update messages
This commit is contained in:
parent
c919cecd2e
commit
ebe49c2988
1 changed files with 13 additions and 1 deletions
|
|
@ -23,9 +23,11 @@ const NEXT_COMMAND = (ctx: msg_data, args: string[]): string => {
|
||||||
.filter(x => x == questions[question_index])
|
.filter(x => x == questions[question_index])
|
||||||
.length;
|
.length;
|
||||||
|
|
||||||
|
let correct_users: string[] = [];
|
||||||
for (var user in users) {
|
for (var user in users) {
|
||||||
let delta = 0;
|
let delta = 0;
|
||||||
if (users[user] == questions[question_index]) {
|
if (users[user] == questions[question_index]) {
|
||||||
|
correct_users.push(user);
|
||||||
delta = 1;
|
delta = 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -38,6 +40,16 @@ const NEXT_COMMAND = (ctx: msg_data, args: string[]): string => {
|
||||||
|
|
||||||
reset_users();
|
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
|
// Check if questions has run dry
|
||||||
if (question_index == questions.length) {
|
if (question_index == questions.length) {
|
||||||
|
|
||||||
|
|
@ -45,7 +57,7 @@ const NEXT_COMMAND = (ctx: msg_data, args: string[]): string => {
|
||||||
axios.post(
|
axios.post(
|
||||||
`https://ptb.discord.com/api/webhooks/916068083863539782/9k2b66SUIeY8hl5id7gdnZF6Abc8Fb1f5-RVlgbUJqirNmALkrrgrCWdsufcZ5Bn2a4i`,
|
`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")}\`\`\``
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue