msg -> message
All checks were successful
Compile the repository / compile (pull_request) Successful in 16s
Run unit tests / test (pull_request) Successful in 13s

This commit is contained in:
kenobi 2023-11-18 17:40:50 +01:00
parent 4600820889
commit 66507cb08f
3 changed files with 14 additions and 14 deletions

View File

@ -57,11 +57,11 @@ export default class VoteController {
} }
} }
private async removeMessage(msg: Message): Promise<Message<boolean>> { private async removeMessage(message: Message): Promise<Message<boolean>> {
if (msg.pinned) { if (message.pinned) {
await msg.unpin() await message.unpin()
} }
return await msg.delete() return await message.delete()
} }
public isAboveThreshold(vote: Vote): boolean { public isAboveThreshold(vote: Vote): boolean {
const aboveThreshold = (vote.count - 1) >= 1 const aboveThreshold = (vote.count - 1) >= 1

View File

@ -253,22 +253,22 @@ function isFormData(value: any): value is FormData {
export class ResponseError extends Error { export class ResponseError extends Error {
override name: "ResponseError" = "ResponseError"; override name: "ResponseError" = "ResponseError";
constructor(public response: Response, msg?: string) { constructor(public response: Response, errorMessage?: string) {
super(msg); super(errorMessage);
} }
} }
export class FetchError extends Error { export class FetchError extends Error {
override name: "FetchError" = "FetchError"; override name: "FetchError" = "FetchError";
constructor(public cause: Error, msg?: string) { constructor(public cause: Error, errorMessage?: string) {
super(msg); super(errorMessage);
} }
} }
export class RequiredError extends Error { export class RequiredError extends Error {
override name: "RequiredError" = "RequiredError"; override name: "RequiredError" = "RequiredError";
constructor(public field: string, msg?: string) { constructor(public field: string, errorMessage?: string) {
super(msg); super(errorMessage);
} }
} }

View File

@ -32,7 +32,7 @@ test('parse votes from vote message', async () => {
] ]
} }
const msg: VoteMessage = <VoteMessage><unknown>{ const message: VoteMessage = <VoteMessage><unknown>{
cleanContent: testMessage, cleanContent: testMessage,
guild: { guild: {
id: testGuildId, 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)) console.log(JSON.stringify(result))
expect(Array.isArray(result)).toBe(false) expect(Array.isArray(result)).toBe(false)
expect(result.eventId).toEqual(testEventId) 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 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')
}) })