• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

WolferyScripting / WolferyJS / #17

01 Sep 2025 09:19PM UTC coverage: 63.335% (+3.5%) from 59.799%
#17

push

DonovanDMC
0.0.6

95 of 253 branches covered (37.55%)

Branch coverage included in aggregate %.

7592 of 11884 relevant lines covered (63.88%)

1.32 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

64.86
/lib/collections/IdentityNotices.ts
1
import BaseCollection from "./BaseCollection.js";
1✔
2
import type WolferyJS from "../WolferyJS.js";
1✔
3
import { toID } from "../util/Util.js";
1✔
4
import type Notice from "../models/Notice.js";
1✔
5
import ResourceIDs from "../generated/ResourceIDs.js";
1✔
6
import type Player from "../models/Player.js";
1✔
7
import type { ResClient } from "resclient-ts";
1✔
8

1✔
9
// do not edit the first line of the class comment
1✔
10
/**
1✔
11
 * The identity notices for the logged in user. @TODO unfinished
1✔
12
 * @resourceID {@link ResourceIDs.IDENTITY_NOTICES | IDENTITY_NOTICES}
1✔
13
 */
1✔
14
export default class IdentityNotices extends BaseCollection<Notice, typeof ResourceIDs.NOTICE> {
1✔
15
    constructor(client: WolferyJS, api: ResClient, rid: string) {
1✔
16
        super(client, api, rid, {
×
17
            idCallback:     toID,
×
18
            ridConstructor: ResourceIDs.NOTICE
×
19
        });
×
20
    }
×
21

1✔
22
    get playerId(): string {
1✔
23
        return ResourceIDs.IDENTITY_NOTICES.parts(this.rid).id;
×
24
    }
×
25

1✔
26
    /**
1✔
27
     * Get the player these notices are for.
1✔
28
     * @calls {@link CoreCommands.getPlayer}
1✔
29
     */
1✔
30
    async getPlayer(): Promise<Player> {
1✔
31
        const player = await this.client.commands.core.getPlayer();
×
32
        if (player.id !== this.playerId) {
×
33
            throw new Error(`Authenticated player id ${player.id} does not match collection player id ${this.playerId}`);
×
34
        }
×
35
        return player;
×
36
    }
×
37
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc