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

WolferyScripting / WolferyJS / #18

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

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

25.81
/lib/models/PlayerMailMessage.ts
1
import BaseModel from "./BaseModel.js";
1✔
2
import MailUser from "./MailUser.js";
1✔
3
import type WolferyJS from "../WolferyJS.js";
1✔
4
import type { MailUserProperties, PlayerMailMessageProperties } from "../generated/models/types.js";
1✔
5
import { PlayerMailMessageDefinition } from "../generated/models/definitions.js";
1✔
6
import ResourceIDs from "../generated/ResourceIDs.js";
1✔
7
import type { AnyObject, ResClient } from "resclient-ts";
1✔
8

1✔
9
declare interface PlayerMailMessage extends BaseModel, PlayerMailMessageProperties {}
1✔
10
// do not edit the first line of the class comment
1✔
11
/**
1✔
12
 * A mail message.
1✔
13
 * @resourceID {@link ResourceIDs.PLAYER_MAIL_MESSAGE | PLAYER_MAIL_MESSAGE}
1✔
14
 */
1✔
15
class PlayerMailMessage extends BaseModel implements PlayerMailMessageProperties {
×
16
    from!: MailUser;
×
17
    to!: MailUser;
×
18
    constructor(client: WolferyJS, api: ResClient, rid: string) {
×
19
        super(client, api, rid, { definition: PlayerMailMessageDefinition });
×
20
    }
×
21

×
22
    get id(): string {
×
23
        return ResourceIDs.PLAYER_MAIL_MESSAGE.parts(this.rid).message;
×
24
    }
×
25

×
26
    get playerId(): string {
×
27
        return ResourceIDs.PLAYER_MAIL_MESSAGE.parts(this.rid).player;
×
28
    }
×
29

×
30
    /**
×
31
     * Delete this message.
×
32
     * @playerRequired
×
33
     * @calls {@link PlayerCommands.deleteMail}
×
34
     */
×
35
    async delete(): Promise<null> {
×
36
        return this.client.commands.player.deleteMail(this.playerId, this.id);
×
37
    }
×
38

×
39
    /**
×
40
     * Mark this message as read.
×
41
     * @playerRequired
×
42
     * @calls {@link PlayerCommands.readMail}
×
43
     */
×
44
    async markRead(): Promise<null> {
×
45
        return this.client.commands.player.readMail(this.playerId, this.id);
×
46
    }
×
47

×
48
    override update(props: AnyObject, reset?: boolean): AnyObject | null {
×
49
        const changed = super.update(props, reset);
×
50
        if ("from" in props) {
×
51
            this.from = new MailUser(this.client, this.api, props.from as MailUserProperties);
×
52
        }
×
53
        if ("to" in props) {
×
54
            this.to = new MailUser(this.client, this.api, props.to as MailUserProperties);
×
55
        }
×
56

×
57
        return changed;
×
58
    }
×
59
}
×
60

1✔
61
export default PlayerMailMessage;
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