1
0
mirror of https://github.com/spacebarchat/client.git synced 2024-11-22 10:22:30 +01:00

Allow sending messages in voice based channels

This commit is contained in:
Puyodead1 2023-06-01 10:57:35 -04:00
parent eb962bd804
commit d0a41afab9
No known key found for this signature in database
GPG Key ID: BA5F91AAEF68E5CE

View File

@ -171,25 +171,28 @@ export default class Channel {
this.hasFetchedMessages = true;
console.log(`Fetching messags for ${this.id}`);
app.rest.get<RESTGetAPIChannelMessagesResult | APIError>(
Routes.channelMessages(this.id),
opts,
).then((res) => {
if("code" in res) {
console.error(res);
return;
}
this.messages.addAll(
res.filter((x) => !this.messages.has(x.id)).reverse(),
// .sort((a, b) => {
// const aTimestamp = new Date(a.timestamp as unknown as string);
// const bTimestamp = new Date(b.timestamp as unknown as string);
// return aTimestamp.getTime() - bTimestamp.getTime();
// })
);
}).catch((err) => {
console.error(err);
});
app.rest
.get<RESTGetAPIChannelMessagesResult | APIError>(
Routes.channelMessages(this.id),
opts,
)
.then((res) => {
if ("code" in res) {
console.error(res);
return;
}
this.messages.addAll(
res.filter((x) => !this.messages.has(x.id)).reverse(),
// .sort((a, b) => {
// const aTimestamp = new Date(a.timestamp as unknown as string);
// const bTimestamp = new Date(b.timestamp as unknown as string);
// return aTimestamp.getTime() - bTimestamp.getTime();
// })
);
})
.catch((err) => {
console.error(err);
});
}
@action
@ -213,7 +216,8 @@ export default class Channel {
get isTextChannel() {
return (
this.type === ChannelType.GuildText ||
this.type === ChannelType.GuildStore ||
this.type === ChannelType.GuildVoice ||
this.type === ChannelType.GuildStageVoice ||
this.type === ChannelType.GuildForum ||
this.type === ChannelType.AnnouncementThread ||
this.type === ChannelType.Encrypted ||