@@ -196,7 +196,7 @@ pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
196196 let animated_icon = server. icon . is_some_and ( |hash| hash. is_animated ( ) ) ;
197197 let iden = server. id ;
198198 let banner = server. banner_url ( ) ;
199- let desc = server. description . clone ( ) ;
199+ let desc = server. description . as_ref ( ) . map ( |desc| desc . as_str ( ) ) ;
200200 let mfa_level = server. mfa_level ;
201201 let verification_level = server. verification_level ;
202202 let content_filter = server. explicit_content_filter ;
@@ -205,23 +205,22 @@ pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
205205 let splash = server. splash_url ( ) ;
206206 let premium_level = server. premium_tier ;
207207 let premium_level_str = match premium_level {
208- PremiumTier :: Tier0 => "Tier 0" . into ( ) ,
209- PremiumTier :: Tier1 => "Tier 1" . into ( ) ,
210- PremiumTier :: Tier2 => "Tier 2" . into ( ) ,
211- PremiumTier :: Tier3 => "Tier 3" . into ( ) ,
212- PremiumTier :: Unknown ( level) => format ! ( "Unknown Tier ({})" , level) ,
213- _ => "Unknown" . into ( ) ,
208+ PremiumTier :: Tier0 => "Tier 0" ,
209+ PremiumTier :: Tier1 => "Tier 1" ,
210+ PremiumTier :: Tier2 => "Tier 2" ,
211+ PremiumTier :: Tier3 => "Tier 3" ,
212+ _ => "Unknown" ,
214213 } ;
215214 let boosts = server. premium_subscription_count ;
216215 let channel_count = server. channels . len ( ) ;
217- let channel_counts = server. channels ( ctx. http ( ) ) . await ?. iter ( ) . fold (
216+ let channel_counts = server. id . channels ( ctx. http ( ) ) . await ?. iter ( ) . fold (
218217 HashMap :: from ( [
219218 ( ChannelType :: Text , 0_u32 ) ,
220219 ( ChannelType :: Voice , 0_u32 ) ,
221220 ( ChannelType :: Category , 0_u32 ) ,
222221 ] ) ,
223- |mut acc, ( _ , channel) | {
224- acc. entry ( channel. kind ) . and_modify ( |count| * count += 1 ) ;
222+ |mut acc, channel| {
223+ acc. entry ( channel. base . kind ) . and_modify ( |count| * count += 1 ) ;
225224 acc
226225 } ,
227226 ) ;
@@ -230,7 +229,7 @@ pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
230229 let category_count = channel_counts. get ( & ChannelType :: Category ) . unwrap ( ) ;
231230 let system_channel = server
232231 . system_channel_id
233- . map ( async |id| id. to_channel ( ctx. http ( ) ) . await ) ;
232+ . map ( async |id| id. to_guild_channel ( ctx. http ( ) , Some ( server . id ) ) . await ) ;
234233 let system_channel_mention = if let Some ( future) = system_channel {
235234 let channel = future. await ?;
236235 channel. mention ( ) . to_string ( )
@@ -239,7 +238,7 @@ pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
239238 } ;
240239 let rules_channel = server
241240 . rules_channel_id
242- . map ( async |id| id. to_channel ( ctx. http ( ) ) . await ) ;
241+ . map ( async |id| id. to_guild_channel ( ctx. http ( ) , Some ( server . id ) ) . await ) ;
243242 let rules_channel_mention = if let Some ( future) = rules_channel {
244243 let channel = future. await ?;
245244 channel. mention ( ) . to_string ( )
@@ -248,7 +247,7 @@ pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
248247 } ;
249248 let public_updates_channel = server
250249 . public_updates_channel_id
251- . map ( async |id| id. to_channel ( ctx. http ( ) ) . await ) ;
250+ . map ( async |id| id. to_guild_channel ( ctx. http ( ) , Some ( server . id ) ) . await ) ;
252251 let public_updates_channel_mention = if let Some ( future) = public_updates_channel {
253252 let channel = future. await ?;
254253 channel. mention ( ) . to_string ( )
@@ -280,7 +279,7 @@ pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
280279 let boosters = server
281280 . members
282281 . iter ( )
283- . filter_map ( |( _ , member) | member. premium_since . map ( |_| member. mention ( ) . to_string ( ) ) )
282+ . filter_map ( |member| member. premium_since . map ( |_| member. mention ( ) . to_string ( ) ) )
284283 . collect :: < Box < [ _ ] > > ( )
285284 . join ( ", " ) ;
286285
@@ -302,7 +301,7 @@ pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
302301 )
303302 } ) ;
304303 let member_percentage = if let Some ( max_members) = max_members {
305- ( ( member_count as f64 / max_members as f64 ) * 100_000_f64 ) . round ( ) / 1_000_f64
304+ ( ( member_count as f64 / max_members. get ( ) as f64 ) * 100_000_f64 ) . round ( ) / 1_000_f64
306305 } else {
307306 0_f64
308307 } ;
@@ -343,17 +342,15 @@ pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
343342 false ,
344343 ) ,
345344 ] ;
346- if let Some ( channel) = ctx. guild_channel ( ) . await
345+ if let Some ( channel) = ctx. channel ( ) . await . unwrap ( ) . guild ( )
347346 && let Some ( parent_channel_id) = channel. parent_id
348347 {
349348 let parent_channel = parent_channel_id
350- . to_channel ( ctx. http ( ) )
351- . await ?
352- . guild ( )
353- . unwrap ( ) ;
349+ . to_guild_channel ( ctx. http ( ) , Some ( server. id ) )
350+ . await ?;
354351 const CATEGORY_STAFF : & str = "staff" ;
355- if matches ! ( parent_channel. kind, ChannelType :: Category )
356- && parent_channel. name ( ) == CATEGORY_STAFF
352+ if matches ! ( parent_channel. base . kind, ChannelType :: Category )
353+ && parent_channel. base . name == CATEGORY_STAFF
357354 {
358355 fields. append ( & mut vec ! [
359356 (
@@ -369,33 +366,28 @@ pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
369366 **Filesize Limit:** {} MB",
370367 owner,
371368 match mfa_level {
372- MfaLevel :: None => "None" . into( ) ,
373- MfaLevel :: Elevated => "Require 2FA" . into( ) ,
374- MfaLevel :: Unknown ( level) => format!( "Unknown ({})" , level) ,
375- _ => "Unknown" . into( ) ,
369+ MfaLevel :: None => "None" ,
370+ MfaLevel :: Elevated => "Require 2FA" ,
371+ _ => "Unknown" ,
376372 } ,
377373 match verification_level {
378- VerificationLevel :: None => "None" . into( ) ,
379- VerificationLevel :: Low => "Low" . into( ) ,
380- VerificationLevel :: Medium => "Medium" . into( ) ,
381- VerificationLevel :: High => "High" . into( ) ,
382- VerificationLevel :: Higher => "Higher" . into( ) ,
383- VerificationLevel :: Unknown ( level) => format!( "Unknown ({})" , level) ,
384- _ => "Unknown" . into( ) ,
374+ VerificationLevel :: None => "None" ,
375+ VerificationLevel :: Low => "Low" ,
376+ VerificationLevel :: Medium => "Medium" ,
377+ VerificationLevel :: High => "High" ,
378+ VerificationLevel :: Higher => "Higher" ,
379+ _ => "Unknown" ,
385380 } ,
386381 match content_filter {
387- ExplicitContentFilter :: None => "None" . into( ) ,
388- ExplicitContentFilter :: WithoutRole => "Members without role" . into( ) ,
389- ExplicitContentFilter :: All => "All members" . into( ) ,
390- ExplicitContentFilter :: Unknown ( level) => format!( "Unknown ({})" , level) ,
391- _ => "Unknown" . into( ) ,
382+ ExplicitContentFilter :: None => "None" ,
383+ ExplicitContentFilter :: WithoutRole => "Members without role" ,
384+ ExplicitContentFilter :: All => "All members" ,
385+ _ => "Unknown" ,
392386 } ,
393387 match default_notifs {
394- DefaultMessageNotificationLevel :: All => "All" . into( ) ,
395- DefaultMessageNotificationLevel :: Mentions => "Mentions only" . into( ) ,
396- DefaultMessageNotificationLevel :: Unknown ( level) =>
397- format!( "Unknown ({})" , level) ,
398- _ => "Unknown" . into( ) ,
388+ DefaultMessageNotificationLevel :: All => "All" ,
389+ DefaultMessageNotificationLevel :: Mentions => "Mentions only" ,
390+ _ => "Unknown" ,
399391 } ,
400392 features,
401393 bitrate_limit,
@@ -449,7 +441,7 @@ pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
449441
450442 let mut embed = CreateEmbed :: default ( )
451443 . title ( format ! ( "Information for `{}`" , name) )
452- . description ( format ! ( "**Description:** {}" , desc. unwrap_or( "" . into ( ) ) ) )
444+ . description ( format ! ( "**Description:** {}" , desc. unwrap_or( "" ) ) )
453445 . fields ( fields) ;
454446 if let Some ( icon) = icon {
455447 embed = embed. thumbnail ( icon) ;
0 commit comments