@@ -8,9 +8,10 @@ template beginPrune*(g: Guild;
88 # # Begins a guild prune.
99 getClient.api.beginGuildPrune (g.id, days, include_roles, compute_prune_count)
1010
11- template getPruneCount * (g: Guild ; days: int ): Future [int ] =
11+ template getPruneCount * (g: Guild ;
12+ days: int , include_roles: seq [string ] = @ []): Future [int ] =
1213 # # Gets the prune count.
13- getClient.api.getGuildPruneCount (g.id, days)
14+ getClient.api.getGuildPruneCount (g.id, days, include_roles )
1415
1516template editMFA * (g: Guild ; lvl: MFALevel ; reason = " " ): Future [MFALevel ] =
1617 # # Modify Guild MFA Level, requiring guild ownership.
@@ -24,11 +25,12 @@ template edit*(g: Guild;
2425 name, description, region, afk_channel_id, icon = none string ;
2526 discovery_splash, owner_id, splash, banner = none string ;
2627 system_channel_id, rules_channel_id = none string ;
28+ safety_alerts_channel_id = none string ;
2729 preferred_locale, public_updates_channel_id = none string ;
2830 verification_level, default_message_notifications = none int ;
2931 system_channel_flags = none int ;
3032 explicit_content_filter, afk_timeout = none int ;
31- features: seq [ string ] = @ [ ];
33+ features = none seq [ string ];
3234 premium_progress_bar_enabled = none bool ;
3335 reason = " "
3436): Future [Guild ] =
@@ -42,6 +44,7 @@ template edit*(g: Guild;
4244 getClient.api.editGuild (
4345 g.id, name, description, region, afk_channel_id, icon,
4446 discovery_splash, owner_id, splash, banner,
47+ safety_alerts_channel_id,
4548 system_channel_id, rules_channel_id,
4649 preferred_locale, public_updates_channel_id,
4750 verification_level, default_message_notifications,
@@ -57,25 +60,36 @@ template getAuditLogs*(g: Guild;
5760 # # Get guild audit logs. The maximum limit is 100.
5861 getClient.api.getGuildAuditLogs (g.id, user_id, before, action_type, limit)
5962
63+ template createRole * (g: Guild ,
64+ name: string = " new role" ;
65+ unicode_emoji, icon = none string ;
66+ hoist, mentionable: bool = false ;
67+ permissions: set [PermissionFlags ] = {};
68+ role_colors = none RoleColors ;
69+ color = 0 ; reason = " " ): Future [Role ] =
70+ # # Creates role.
71+ getClient.api.createGuildRole (g.id,
72+ name, unicode_emoji, icon,
73+ hoist, mentionable, permissions,
74+ role_colors, color, reason)
75+
6076template deleteRole * (g: Guild ; r: Role ): Future [void ] =
6177 # # Deletes a guild role.
6278 getClient.api.deleteGuildRole (g.id, r.id)
6379
6480template editRole * (g: Guild ; r: Role ;
6581 name = none string ;
82+ permissions = none set [PermissionFlags ];
6683 icon, unicode_emoji = none string ;
67- permissions = none PermObj ; color = none int ;
84+ colors = none RoleColors ;
85+ color = none int ;
6886 hoist, mentionable = none bool ;
6987 reason = " "
7088): Future [Role ] =
7189 # # Modifies a guild role.
72- getClient.api.editGuildRole (
73- g.id, r.id,
74- name, icon, unicode_emoji,
75- permissions, color,
76- hoist, mentionable,
77- reason
78- )
90+ getClient.api.editGuildRole (g.id, r.id,
91+ name, permissions, icon, unicode_emoji,
92+ colors, color, hoist, mentionable)
7993
8094template getInvites * (g: Guild ): Future [seq [InviteMetadata ]] =
8195 # # Gets guild invites.
@@ -112,10 +126,10 @@ template getBans*(g: Guild): Future[seq[GuildBan]] =
112126 # # Gets all the guild bans.
113127 getClient.api.getGuildBans (g.id)
114128
115- template ban * (g: Guild ; m: Member ; delete_msg_days : range [0 .. 7 ] = 0 ;
129+ template ban * (g: Guild ; m: Member ; delete_message_seconds : range [0 .. 604800 ] = 0 ;
116130 reason = " " ): Future [void ] =
117131 # # Creates a guild ban.
118- getClient.api.createGuildBan (g.id, m.user.id, delete_msg_days , reason)
132+ getClient.api.createGuildBan (g.id, m.user.id, delete_message_seconds , reason)
119133
120134template bulkBan * (g: Guild ;
121135 user_ids: seq [string ];
0 commit comments