temp fix while server is fixing op 8

This commit is contained in:
MathMan05 2024-09-04 11:41:41 -05:00
parent 9aa51d65fd
commit cee146e532
4 changed files with 39 additions and 0 deletions

View file

@ -16,6 +16,7 @@ class Guild extends SnowFlake{
channels:Channel[];
channelids:{[key:string]:Channel};
properties;
member_count:number;
roles:Role[];
roleids:Map<string,Role>;
prevchannel:Channel|undefined;
@ -26,6 +27,7 @@ class Guild extends SnowFlake{
member:Member;
html:HTMLElement;
emojis:emojijson[];
large:boolean;
static contextmenu=new Contextmenu<Guild,undefined>("guild menu");
static setupcontextmenu(){
Guild.contextmenu.addbutton("Copy Guild id",function(this:Guild){
@ -88,6 +90,8 @@ class Guild extends SnowFlake{
console.log(json.stickers,":3");
}
super(json.id);
this.large=json.large;
this.member_count=json.member_count;
this.emojis = json.emojis;
this.owner=owner;
this.headers=this.owner.headers;

View file

@ -1355,6 +1355,21 @@ class Localuser{
if(guildid==="@me"){
return undefined;
}
const guild=this.guildids.get(guildid);
const borked=true;
if(borked&&guild&&guild.member_count>250){//sorry puyo, I need to fix member resolving while it's broken on large guilds
try{
const req=await fetch(this.info.api+"/guilds/"+guild.id+"/members/"+id,{
headers:this.headers
});
if(req.status!==200){
return undefined;
}
return await req.json();
}catch{
return undefined;
}
}
let guildmap=this.waitingmembers.get(guildid);
if(!guildmap){
guildmap=new Map();