mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 21:16:09 +00:00
Add Guild.fetchChannels method
This commit is contained in:
parent
aa147adbf3
commit
2634a5d37c
@ -56,6 +56,7 @@ import {
|
||||
GUILD_WIDGET,
|
||||
USER_GUILDS,
|
||||
CHANNEL,
|
||||
GUILD_CHANNELS,
|
||||
} from '@biscuitland/api-types';
|
||||
import { ChannelFactory, GuildChannel, ReturnThreadsArchive, ThreadChannel, Channel } from './channels';
|
||||
import { Member, ThreadMember } from './members';
|
||||
@ -1220,7 +1221,13 @@ export class Guild extends BaseGuild implements Model {
|
||||
|
||||
return ChannelFactory.from(this.session, channel);
|
||||
}
|
||||
|
||||
|
||||
async fetchChannels(): Promise<Channel[]> {
|
||||
const channels = await this.session.rest.get<DiscordChannel[]>(GUILD_CHANNELS(this.id));
|
||||
|
||||
return channels.map(channel => ChannelFactory.from(this.session, channel));
|
||||
}
|
||||
|
||||
/** fetches a member */
|
||||
async fetchMember(memberId: Snowflake): Promise<Member> {
|
||||
const member = await this.session.rest.get<DiscordMemberWithUser>(
|
||||
|
Loading…
x
Reference in New Issue
Block a user