Skip to content

Commit

Permalink
feat(client): allow the fetching of other_id character on gainexperie…
Browse files Browse the repository at this point in the history
…nce (#71)
  • Loading branch information
microwavekonijn authored Jun 8, 2022
1 parent d2a384b commit f5a888e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/client/events/gain-experience.event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ export class GainExperience extends CharacterEvent {
readonly other_id: string;
readonly zone_id: string;

/**
* Fetch the character data of other if any
*
* @return {Promise<any | undefined>}
*/
async other(): Promise<any | undefined> {
if (this.other_id.length == 19)
return this.client.characterManager.fetch(this.character_id);
}

toHash(): string {
return `GainExperience:${this.character_id}:${this.timestamp}`;
}
Expand Down

0 comments on commit f5a888e

Please sign in to comment.