forked from billsonnn/nitro-renderer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
billsonnn#9 - GuildMemberMgmtFailedMessageEvent added
- Loading branch information
Showing
6 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/nitro/communication/messages/incoming/user/GuildMemberMgmtFailedMessageEvent.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { IMessageEvent } from '../../../../../api'; | ||
import { MessageEvent } from '../../../../../events'; | ||
import { GuildMemberMgmtFailedMessageParser } from '../../parser'; | ||
|
||
export class GuildMemberMgmtFailedMessageEvent extends MessageEvent implements IMessageEvent | ||
{ | ||
constructor(callBack: Function) | ||
{ | ||
super(callBack, GuildMemberMgmtFailedMessageParser); | ||
} | ||
|
||
public getParser(): GuildMemberMgmtFailedMessageParser | ||
{ | ||
return this.parser as GuildMemberMgmtFailedMessageParser; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/nitro/communication/messages/parser/user/GuildMemberMgmtFailedMessageParser.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { IMessageDataWrapper, IMessageParser } from '../../../../../api'; | ||
|
||
export class GuildMemberMgmtFailedMessageParser implements IMessageParser | ||
{ | ||
private _guildId: number; | ||
private _reason: number; | ||
|
||
public flush(): boolean | ||
{ | ||
this._guildId = -1; | ||
this._reason = -1; | ||
|
||
return true; | ||
} | ||
|
||
public parse(wrapper: IMessageDataWrapper): boolean | ||
{ | ||
if(!wrapper) return false; | ||
|
||
this._guildId = wrapper.readInt(); | ||
this._reason = wrapper.readInt(); | ||
|
||
return true; | ||
} | ||
|
||
public get guildId(): number | ||
{ | ||
return this._guildId; | ||
} | ||
|
||
public get reason(): number | ||
{ | ||
return this._reason; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters