-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathresponses.js
74 lines (61 loc) · 2.5 KB
/
responses.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
let responses = {
duplicate_vote : (from) => `😕 ${from} you are not allowed to vote more than once!`,
valid_vote : (from) => ` Thank you, ${from}, your vote has been taken ✔️`,
chooseValidCandidate: (from) => `😕 ${from}, please choose a valid candidate`,
no_candidate: '😕 There are no candidates now',
no_candidate_supplied: '😕 No candidate supplied, please supply at least one',
no_votes: '😕 No votes cast so far',
added_candidates: ' 👍 Candidate(s) have been added',
deleted_candidate: ' 👍 Candidate has been removed',
deleted_candidates: ' 👍 All Candidates have been removed',
deleted_votes: ' 👍 All Votes have been removed',
not_allowed: ' 👿 👎 You are not authorized to perform this action!',
draw: '😇 We currently have a draw!',
list_of_candidate: (showCandidates) => {
let respo = showCandidates()
respo+= `\n 0 - Cancel`
return respo
},
confirm_add_of_candidates: () => {
let respo = `
Are you sure you want to add more candidates, if yes?
Provide a value of comma seperated candidates
E.g candidate1,candidate2,candidate3
\n 0 - Cancel`
return respo
},
confirm_delete_of_candidate: (showCandidates) => {
let respo = `
Are you sure you want to remove a candidate,
this would also remove their votes so far, if yes?
`
respo += showCandidates()
respo+= `\n 0 - Cancel`
return respo
},
confirm_delete_of_candidates: () => {
let respo = `
Are you sure you want to remove all candidates?
1 - to continue
\n Any key - Cancel`
return respo
},
confirm_delete_of_votes: () => {
let respo = `
Are you sure you want to remove all votes so far?
1 - to continue
\n Any key - Cancel`
return respo
},
cancelVote: '👍 Voting has been cancelled',
cancelAddCandidates: '👍 Addition of Candidate(s) has been cancelled',
cancelDeleteCandidate: '👍 Deletion of Candidate has been cancelled',
cancelDeleteCandidates: '👍 Deletion of Candidates has been cancelled',
cancelDeleteVotes: '👍 Deletion of Votes has been cancelled',
showResult: (res) => {
return res.candidate.map(e =>
`${e.name} - ${e.percentage}% of votes cast - ${e.total} votes accumulated`
).join('\n')
}
}
module.exports = responses