This repository has been archived by the owner on Jan 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ruairi <[email protected]>
- Loading branch information
1 parent
3dd4e2c
commit d920e9d
Showing
99 changed files
with
3,389 additions
and
589 deletions.
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
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 |
---|---|---|
|
@@ -27,6 +27,6 @@ | |
"packages/*" | ||
], | ||
"devDependencies": { | ||
"@changesets/cli": "^2.22.0" | ||
"@changesets/cli": "^2.26.1" | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 @@ | ||
import ws from '../../ws'; |
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
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,4 @@ | ||
export const Constants = { | ||
ApplicationInstallUrl: (query: string) => | ||
`https://discord.com/api/oauth2/authorize?${query}`, | ||
}; |
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,13 @@ | ||
export abstract class BaseStructure<T> { | ||
constructor(public _data?: T) { | ||
Object.defineProperty(this, '_data', { | ||
enumerable: false, | ||
}); | ||
} | ||
abstract toJSON(): T; | ||
|
||
public static toJSON(data: any): any { | ||
if (data.toJSON && typeof data.toJSON === 'function') return data.toJSON(); | ||
else return {}; | ||
} | ||
} |
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,54 @@ | ||
import { APIRole, Snowflake } from 'discord-api-types/v10'; | ||
import { BaseStructure } from './BaseStructure'; | ||
|
||
export class Role extends BaseStructure<APIRole> { | ||
id: Snowflake; | ||
name: string; | ||
color: number; | ||
hoist: boolean; | ||
icon: string | null; | ||
|
||
unicodeEmoji: string | null; | ||
|
||
position: number; | ||
permissions: string; | ||
managed: boolean; | ||
mentionable: boolean; | ||
|
||
// TODO: role tags | ||
tags = null; | ||
|
||
constructor(data: APIRole) { | ||
super(data); | ||
|
||
this.id = data.id; | ||
this.name = data.name; | ||
this.color = data.color; | ||
this.hoist = data.hoist; | ||
this.icon = data.icon ?? null; | ||
|
||
this.unicodeEmoji = data.unicode_emoji ?? null; | ||
this.position = data.position; | ||
this.permissions = data.permissions; | ||
this.managed = data.managed; | ||
this.mentionable = data.mentionable; | ||
|
||
// TODO | ||
// this.tags = data.tags; | ||
} | ||
|
||
toJSON(): APIRole { | ||
return { | ||
id: this.id, | ||
name: this.name, | ||
color: this.color, | ||
hoist: this.hoist, | ||
icon: this.icon, | ||
unicode_emoji: this.unicodeEmoji, | ||
position: this.position, | ||
permissions: this.permissions, | ||
managed: this.managed, | ||
mentionable: this.mentionable, | ||
}; | ||
} | ||
} |
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,6 @@ | ||
import { APIUser } from 'discord-api-types/v10'; | ||
import { BaseStructure } from './BaseStructure'; | ||
|
||
export class User extends BaseStructure<APIUser> { | ||
constructor(data: APIUser) {} | ||
} |
Oops, something went wrong.