2 Commits

Author SHA1 Message Date
Abelfreyja
d78f9dafcc chat disable perms added 2025-12-22 10:25:42 +09:00
8e4432af45 Merge pull request 'bumped api version' (#17) from bump-api into main
Reviewed-on: #17
2025-12-19 15:30:57 +00:00
2 changed files with 29 additions and 17 deletions

View File

@@ -8,4 +8,5 @@ public enum GroupPermissions
PreferDisableSounds = 0x2, PreferDisableSounds = 0x2,
DisableInvites = 0x4, DisableInvites = 0x4,
PreferDisableVFX = 0x8, PreferDisableVFX = 0x8,
DisableChat = 0x10,
} }

View File

@@ -24,6 +24,11 @@ public static class GroupPermissionsExtensions
return perm.HasFlag(GroupPermissions.PreferDisableVFX); return perm.HasFlag(GroupPermissions.PreferDisableVFX);
} }
public static bool IsDisableChat(this GroupPermissions perm)
{
return perm.HasFlag(GroupPermissions.DisableChat);
}
public static void SetDisableInvites(this ref GroupPermissions perm, bool set) public static void SetDisableInvites(this ref GroupPermissions perm, bool set)
{ {
if (set) perm |= GroupPermissions.DisableInvites; if (set) perm |= GroupPermissions.DisableInvites;
@@ -47,4 +52,10 @@ public static class GroupPermissionsExtensions
if (set) perm |= GroupPermissions.PreferDisableVFX; if (set) perm |= GroupPermissions.PreferDisableVFX;
else perm &= ~GroupPermissions.PreferDisableVFX; else perm &= ~GroupPermissions.PreferDisableVFX;
} }
public static void SetDisableChat(this ref GroupPermissions perm, bool set)
{
if (set) perm |= GroupPermissions.DisableChat;
else perm &= ~GroupPermissions.DisableChat;
}
} }