feat/40-reroll-on-disinterest #54
@ -57,11 +57,11 @@ export default class VoteController {
|
||||
}
|
||||
}
|
||||
|
||||
private async removeMessage(msg: Message): Promise<Message<boolean>> {
|
||||
if (msg.pinned) {
|
||||
await msg.unpin()
|
||||
private async removeMessage(message: Message): Promise<Message<boolean>> {
|
||||
magnetotail marked this conversation as resolved
Outdated
|
||||
if (message.pinned) {
|
||||
await message.unpin()
|
||||
}
|
||||
return await msg.delete()
|
||||
return await message.delete()
|
||||
}
|
||||
public isAboveThreshold(vote: Vote): boolean {
|
||||
magnetotail marked this conversation as resolved
Outdated
magnetotail
commented
above WHAT threshold? What does it do?? above WHAT threshold? What does it do??
kenobi
commented
20da25f2bf9a473704f8b4660e5f05183679ba39
kenobi
commented
Mit einem Kommentar versehen und entsprechend deines vorschlags umbenannt Mit einem Kommentar versehen und entsprechend deines vorschlags umbenannt
|
||||
const aboveThreshold = (vote.count - 1) >= 1
|
||||
magnetotail marked this conversation as resolved
Outdated
magnetotail
commented
threshold seems to be a magic number threshold seems to be a magic number
magnetotail
commented
Or rename method to "hasAtLeastOneVote" Or rename method to "hasAtLeastOneVote"
kenobi
commented
296a490e935cbdb79b70d73d2df9bc12a5774c53
kenobi
commented
done done
|
||||
|
@ -253,22 +253,22 @@ function isFormData(value: any): value is FormData {
|
||||
|
||||
export class ResponseError extends Error {
|
||||
override name: "ResponseError" = "ResponseError";
|
||||
constructor(public response: Response, msg?: string) {
|
||||
super(msg);
|
||||
constructor(public response: Response, errorMessage?: string) {
|
||||
super(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
export class FetchError extends Error {
|
||||
override name: "FetchError" = "FetchError";
|
||||
constructor(public cause: Error, msg?: string) {
|
||||
super(msg);
|
||||
constructor(public cause: Error, errorMessage?: string) {
|
||||
super(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
export class RequiredError extends Error {
|
||||
override name: "RequiredError" = "RequiredError";
|
||||
constructor(public field: string, msg?: string) {
|
||||
super(msg);
|
||||
constructor(public field: string, errorMessage?: string) {
|
||||
super(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ test('parse votes from vote message', async () => {
|
||||
]
|
||||
}
|
||||
|
||||
const msg: VoteMessage = <VoteMessage><unknown>{
|
||||
const message: VoteMessage = <VoteMessage><unknown>{
|
||||
cleanContent: testMessage,
|
||||
guild: {
|
||||
id: testGuildId,
|
||||
@ -58,7 +58,7 @@ test('parse votes from vote message', async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const result = await voteController.parseVoteInfoFromVoteMessage(msg, 'requestId')
|
||||
const result = await voteController.parseVoteInfoFromVoteMessage(message, 'requestId')
|
||||
console.log(JSON.stringify(result))
|
||||
expect(Array.isArray(result)).toBe(false)
|
||||
expect(result.eventId).toEqual(testEventId)
|
||||
@ -158,7 +158,7 @@ test.skip('handles complete none_of_that vote', () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
const msgReaction: MessageReaction = <MessageReaction><unknown>{
|
||||
const messageReaction: MessageReaction = <MessageReaction><unknown>{
|
||||
message: reactedUponMessage
|
||||
}
|
||||
|
||||
@ -170,7 +170,7 @@ test.skip('handles complete none_of_that vote', () => {
|
||||
}
|
||||
})
|
||||
|
||||
const res = voteController.handleNoneOfThatVote(msgReaction, reactedUponMessage, 'requestId', 'guildId')
|
||||
const res = voteController.handleNoneOfThatVote(messageReaction, reactedUponMessage, 'requestId', 'guildId')
|
||||
|
||||
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user
Parameter die eine Message sind heißen oft "message", manchmal aber auch "msg". sollte vereinheitlicht sein
66507cb08f
fc64728a78
Jetzt sollten alle Occurences beseitigt sein.