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

Method createRole

src/webpage/guild.ts:2120–2135  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

2118 body: JSON.stringify({
2119 name,
2120 color: 0,
2121 permissions: "0",
2122 }),
2123 });
2124 const json = await fetched.json();
2125 const role = new Role(json, this);
2126 this.roleids.set(role.id, role);
2127 this.roles.push(role);
2128 return role;
2129 }
2130 async updateRolePermissions(id: string, perms: Permissions) {
2131 const role = this.roleids.get(id);
2132 if (!role) {
2133 return;
2134 }
2135 role.permissions.allow = perms.allow;
2136 role.permissions.deny = perms.deny;
2137
2138 await fetch(this.info.api + "/guilds/" + this.id + "/roles/" + role.id, {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected