temp fix while server is fixing op 8
This commit is contained in:
parent
9aa51d65fd
commit
cee146e532
4 changed files with 39 additions and 0 deletions
|
@ -12,6 +12,7 @@ class Guild extends SnowFlake {
|
||||||
channels;
|
channels;
|
||||||
channelids;
|
channelids;
|
||||||
properties;
|
properties;
|
||||||
|
member_count;
|
||||||
roles;
|
roles;
|
||||||
roleids;
|
roleids;
|
||||||
prevchannel;
|
prevchannel;
|
||||||
|
@ -22,6 +23,7 @@ class Guild extends SnowFlake {
|
||||||
member;
|
member;
|
||||||
html;
|
html;
|
||||||
emojis;
|
emojis;
|
||||||
|
large;
|
||||||
static contextmenu = new Contextmenu("guild menu");
|
static contextmenu = new Contextmenu("guild menu");
|
||||||
static setupcontextmenu() {
|
static setupcontextmenu() {
|
||||||
Guild.contextmenu.addbutton("Copy Guild id", function () {
|
Guild.contextmenu.addbutton("Copy Guild id", function () {
|
||||||
|
@ -78,6 +80,8 @@ class Guild extends SnowFlake {
|
||||||
console.log(json.stickers, ":3");
|
console.log(json.stickers, ":3");
|
||||||
}
|
}
|
||||||
super(json.id);
|
super(json.id);
|
||||||
|
this.large = json.large;
|
||||||
|
this.member_count = json.member_count;
|
||||||
this.emojis = json.emojis;
|
this.emojis = json.emojis;
|
||||||
this.owner = owner;
|
this.owner = owner;
|
||||||
this.headers = this.owner.headers;
|
this.headers = this.owner.headers;
|
||||||
|
|
|
@ -1356,6 +1356,22 @@ class Localuser {
|
||||||
if (guildid === "@me") {
|
if (guildid === "@me") {
|
||||||
return undefined;
|
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);
|
let guildmap = this.waitingmembers.get(guildid);
|
||||||
if (!guildmap) {
|
if (!guildmap) {
|
||||||
guildmap = new Map();
|
guildmap = new Map();
|
||||||
|
|
|
@ -16,6 +16,7 @@ class Guild extends SnowFlake{
|
||||||
channels:Channel[];
|
channels:Channel[];
|
||||||
channelids:{[key:string]:Channel};
|
channelids:{[key:string]:Channel};
|
||||||
properties;
|
properties;
|
||||||
|
member_count:number;
|
||||||
roles:Role[];
|
roles:Role[];
|
||||||
roleids:Map<string,Role>;
|
roleids:Map<string,Role>;
|
||||||
prevchannel:Channel|undefined;
|
prevchannel:Channel|undefined;
|
||||||
|
@ -26,6 +27,7 @@ class Guild extends SnowFlake{
|
||||||
member:Member;
|
member:Member;
|
||||||
html:HTMLElement;
|
html:HTMLElement;
|
||||||
emojis:emojijson[];
|
emojis:emojijson[];
|
||||||
|
large:boolean;
|
||||||
static contextmenu=new Contextmenu<Guild,undefined>("guild menu");
|
static contextmenu=new Contextmenu<Guild,undefined>("guild menu");
|
||||||
static setupcontextmenu(){
|
static setupcontextmenu(){
|
||||||
Guild.contextmenu.addbutton("Copy Guild id",function(this:Guild){
|
Guild.contextmenu.addbutton("Copy Guild id",function(this:Guild){
|
||||||
|
@ -88,6 +90,8 @@ class Guild extends SnowFlake{
|
||||||
console.log(json.stickers,":3");
|
console.log(json.stickers,":3");
|
||||||
}
|
}
|
||||||
super(json.id);
|
super(json.id);
|
||||||
|
this.large=json.large;
|
||||||
|
this.member_count=json.member_count;
|
||||||
this.emojis = json.emojis;
|
this.emojis = json.emojis;
|
||||||
this.owner=owner;
|
this.owner=owner;
|
||||||
this.headers=this.owner.headers;
|
this.headers=this.owner.headers;
|
||||||
|
|
|
@ -1355,6 +1355,21 @@ class Localuser{
|
||||||
if(guildid==="@me"){
|
if(guildid==="@me"){
|
||||||
return undefined;
|
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);
|
let guildmap=this.waitingmembers.get(guildid);
|
||||||
if(!guildmap){
|
if(!guildmap){
|
||||||
guildmap=new Map();
|
guildmap=new Map();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue