mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00
Resolve conflicts
This commit is contained in:
commit
17b4021fc6
1
mod.ts
1
mod.ts
@ -7,4 +7,3 @@ export * from './packages/discordeno/mod.ts';
|
|||||||
export * from './packages/cache/mod.ts';
|
export * from './packages/cache/mod.ts';
|
||||||
export * from './packages/api-types/discord.ts';
|
export * from './packages/api-types/discord.ts';
|
||||||
export * from './packages/api-types/shared.ts';
|
export * from './packages/api-types/shared.ts';
|
||||||
export { default as enableCache } from './packages/cache/mod.ts';
|
|
||||||
|
@ -32,6 +32,7 @@ import Invite from './Invite.ts';
|
|||||||
import Webhook from './Webhook.ts';
|
import Webhook from './Webhook.ts';
|
||||||
import User from './User.ts';
|
import User from './User.ts';
|
||||||
import ThreadMember from './ThreadMember.ts';
|
import ThreadMember from './ThreadMember.ts';
|
||||||
|
import Permissions, { PermissionResolvable } from "./Permissions.ts";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract class that represents the base for creating a new channel.
|
* Abstract class that represents the base for creating a new channel.
|
||||||
@ -91,25 +92,45 @@ export abstract class BaseChannel implements Model {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
/** CategoryChannel */
|
/** CategoryChannel */
|
||||||
|
=======
|
||||||
|
/**
|
||||||
|
* Represents a category channel.
|
||||||
|
*/
|
||||||
|
>>>>>>> 50213749703d33ee39bdc1044e03fa18cd3a7052
|
||||||
export class CategoryChannel extends BaseChannel {
|
export class CategoryChannel extends BaseChannel {
|
||||||
constructor(session: Session, data: DiscordChannel) {
|
constructor(session: Session, data: DiscordChannel) {
|
||||||
super(session, data);
|
super(session, data);
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
this.name = data.name ? data.name : '';
|
this.name = data.name ? data.name : '';
|
||||||
this.permissionOverwrites = data.permission_overwrites ? data.permission_overwrites : undefined;
|
|
||||||
this.nsfw = data.nsfw ? data.nsfw : false;
|
this.nsfw = data.nsfw ? data.nsfw : false;
|
||||||
this.guildId = data.guild_id ? data.guild_id : undefined;
|
this.guildId = data.guild_id ? data.guild_id : undefined;
|
||||||
this.type = ChannelTypes.GuildCategory;
|
this.type = ChannelTypes.GuildCategory;
|
||||||
this.position = data.position ? data.position : 0;
|
this.position = data.position ? data.position : undefined;
|
||||||
|
this.parentId = data.parent_id ? data.parent_id : undefined;
|
||||||
|
|
||||||
|
this.permissionOverwrites = [] as PermissionsOverwrites[];
|
||||||
|
// TODO: improve this and test
|
||||||
|
if (data.permission_overwrites && data.permission_overwrites.length > 0) {
|
||||||
|
data.permission_overwrites.forEach(v => {
|
||||||
|
this.permissionOverwrites.push({
|
||||||
|
id: v.id,
|
||||||
|
type: v.type,
|
||||||
|
allow: new Permissions(parseInt(v.allow as string) as PermissionResolvable),
|
||||||
|
deny: new Permissions(parseInt(v.deny as string) as PermissionResolvable),
|
||||||
|
} as PermissionsOverwrites);
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
id: Snowflake;
|
id: Snowflake;
|
||||||
|
parentId?: string;
|
||||||
name: string;
|
name: string;
|
||||||
permissionOverwrites?: DiscordOverwrite[];
|
permissionOverwrites: PermissionsOverwrites[];
|
||||||
nsfw: boolean;
|
nsfw: boolean;
|
||||||
guildId?: Snowflake;
|
guildId?: Snowflake;
|
||||||
position: number;
|
position?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** TextChannel */
|
/** TextChannel */
|
||||||
|
1
packages/cache/mod.ts
vendored
1
packages/cache/mod.ts
vendored
@ -76,4 +76,3 @@ export function enableCache(session: Session): SessionCache {
|
|||||||
return cache;
|
return cache;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default enableCache;
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user