MCPcopy Create free account
hub / github.com/MathMan05/Fermi / bind

Method bind

src/webpage/user.ts:946–984  ·  view source on GitHub ↗
(
		html: HTMLElement,
		guild: Guild | null = null,
		error = true,
		button: "right" | "left" | "none" = "right",
	)

Source from the content-addressed store, hash-verified

944 bind(
945 html: HTMLElement,
946 guild: Guild | null = null,
947 error = true,
948 button: "right" | "left" | "none" = "right",
949 ): void {
950 if (guild && guild.id !== "@me") {
951 Member.resolveMember(this, guild)
952 .then((member) => {
953 User.contextmenu.bindContextmenu(html, this, member);
954 if (member === undefined && error) {
955 if (this.webhook_id) return;
956 const errorSpan = document.createElement("span");
957 errorSpan.textContent = "!";
958 errorSpan.classList.add("membererror");
959 html.after(errorSpan);
960 return;
961 }
962 if (member) {
963 member.bind(html);
964 } else {
965 if (button !== "none")
966 User.contextmenu.bindContextmenu(html, this, undefined, undefined, undefined, button);
967 }
968 })
969 .catch((err) => {
970 console.log(err);
971 });
972 } else {
973 if (button !== "none")
974 User.contextmenu.bindContextmenu(html, this, undefined, undefined, undefined, button);
975 }
976 if (button !== "none")
977 if (guild) {
978 this.profileclick(html, guild);
979 } else {
980 this.profileclick(html);
981 }
982 }
983
984 static async resolve(id: string, localuser: Localuser): Promise<User> {
985 const time = SnowFlake.stringToUnixTime(id);
986
987 if (time < 1420070400000 + 100)

Callers 15

createWidgetMethod · 0.95
generateMessageMethod · 0.95
genuserstripMethod · 0.45
markdownMethod · 0.45
setCustomBoxMethod · 0.45
boxupdateMethod · 0.45
saveCaretPositionFunction · 0.45
getTextNodeAtPositionFunction · 0.45
makeMemberDivMethod · 0.45
packetMethod · 0.45
generateHTMLMethod · 0.45
generateHTMLMethod · 0.45

Calls 4

profileclickMethod · 0.95
bindContextmenuMethod · 0.80
addMethod · 0.80
resolveMemberMethod · 0.45

Tested by

no test coverage detected