This commit is contained in:
MathMan05
2024-12-10 11:44:56 -06:00
parent 127a9e8250
commit 0ced3f594c
4 changed files with 23 additions and 3 deletions

View File

@@ -761,7 +761,7 @@ class Channel extends SnowFlake{
typebox.classList.remove("typeboxreplying");
}
}
async getmessage(id: string): Promise<Message>{
async getmessage(id: string): Promise<Message|undefined>{
const message = this.messages.get(id);
if(message){
return message;
@@ -771,6 +771,9 @@ class Channel extends SnowFlake{
{ headers: this.headers }
);
const json = await gety.json();
if(json.length===0){
return undefined;
}
return new Message(json[0], this);
}
}