(g: UserGuild)
| 48 | const permManageServer = BigInt("0x0000000020"); |
| 49 | |
| 50 | function userGuildHasAdmin(g: UserGuild): boolean { |
| 51 | if (g.owner) { |
| 52 | return true |
| 53 | } |
| 54 | |
| 55 | |
| 56 | const perms = BigInt(g.permissions); |
| 57 | if ((perms & permAdmin) === permAdmin) { |
| 58 | return true |
| 59 | } |
| 60 | |
| 61 | if ((perms & permManageServer) === permManageServer) { |
| 62 | return true |
| 63 | } |
| 64 | |
| 65 | return false |
| 66 | } |