Skip to content

Commit

Permalink
Changed arguments order for reason to be last
Browse files Browse the repository at this point in the history
  • Loading branch information
LaPepega authored and Lulalaby committed Apr 3, 2024
1 parent c56f44b commit a9342da
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 79 deletions.
28 changes: 14 additions & 14 deletions DisCatSharp/Entities/Channel/DiscordChannel.cs
Expand Up @@ -330,7 +330,7 @@ internal DiscordChannel(List<string>? ignored = null)
this._permissionOverwritesLazy = new(() => new ReadOnlyCollection<DiscordOverwrite>(this.PermissionOverwritesInternal));
}

#region Methods
#region Methods

/// <summary>
/// Sends a message to this channel.
Expand Down Expand Up @@ -515,7 +515,7 @@ public Task ModifyAsync(Action<ChannelEditModel> action)

return this.Discord.ApiClient.ModifyChannelAsync(this.Id, mdl.Name, mdl.Position, mdl.Topic, mdl.Nsfw,
mdl.Parent.Map(p => p?.Id), mdl.Bitrate, mdl.UserLimit, mdl.PerUserRateLimit, mdl.RtcRegion.Map(r => r?.Id),
mdl.QualityMode, mdl.DefaultAutoArchiveDuration, mdl.Type, mdl.PermissionOverwrites, mdl.Flags, mdl.AuditLogReason, mdl.ForumLayout);
mdl.QualityMode, mdl.ForumLayout, mdl.DefaultAutoArchiveDuration, mdl.Type, mdl.PermissionOverwrites, mdl.Flags, mdl.AuditLogReason);
}

/// <summary>
Expand All @@ -539,7 +539,7 @@ public Task ModifyForumAsync(Action<ForumChannelEditModel> action)
? throw new NotSupportedException("Cannot have more than 20 tags in a forum channel.")
: (Task)this.Discord.ApiClient.ModifyForumChannelAsync(this.Id, mdl.Name, mdl.Position, mdl.Topic, mdl.Template, mdl.Nsfw,
mdl.Parent.Map(p => p?.Id), mdl.AvailableTags, mdl.DefaultReactionEmoji, mdl.PerUserRateLimit, mdl.PostCreateUserRateLimit,
mdl.DefaultSortOrder, mdl.DefaultAutoArchiveDuration, mdl.PermissionOverwrites, mdl.Flags, mdl.AuditLogReason, mdl.DefaultForumLayout);
mdl.DefaultSortOrder, mdl.DefaultForumLayout, mdl.DefaultAutoArchiveDuration, mdl.PermissionOverwrites, mdl.Flags, mdl.AuditLogReason);
}

/// <summary>
Expand Down Expand Up @@ -965,7 +965,7 @@ public Task DeleteMessageAsync(DiscordMessage message, string reason = null)
public Task<DiscordInvite> CreateInviteAsync(int maxAge = 86400, int maxUses = 0, bool temporary = false, bool unique = false, TargetType? targetType = null, ulong? targetApplicationId = null, ulong? targetUser = null, string reason = null)
=> this.Discord.ApiClient.CreateChannelInviteAsync(this.Id, maxAge, maxUses, targetType, targetApplicationId, targetUser, temporary, unique, reason);

#region Voice Channel
#region Voice Channel

/// <summary>
/// Sets a voice channels status.
Expand All @@ -988,9 +988,9 @@ public Task SetVoiceChannelStatusAsync(string status)
public Task RemoveVoiceChannelStatusAsync(string reason = null)
=> this.Type != ChannelType.Voice ? throw new NotSupportedException("Cannot execute this request on a non-voice channel.") : this.Discord.ApiClient.ModifyVoiceChannelStatusAsync(this.Id, null);

#endregion
#endregion

#region Stage
#region Stage

/// <summary>
/// Opens a stage.
Expand Down Expand Up @@ -1041,9 +1041,9 @@ public async Task CloseStageAsync(string reason = null)
public async Task<DiscordStageInstance> GetStageAsync()
=> await this.Discord.ApiClient.GetStageInstanceAsync(this.Id).ConfigureAwait(false);

#endregion
#endregion

#region Scheduled Events
#region Scheduled Events

/// <summary>
/// Creates a scheduled event based on the channel type.
Expand All @@ -1067,9 +1067,9 @@ public async Task<DiscordScheduledEvent> CreateScheduledEventAsync(string name,
return await this.Guild.CreateScheduledEventAsync(name, scheduledStartTime, null, this, null, description, type, coverImage, reason).ConfigureAwait(false);
}

#endregion
#endregion

#region Threads
#region Threads

/// <summary>
/// Creates a thread.
Expand Down Expand Up @@ -1204,7 +1204,7 @@ public async Task<DiscordChannel> CreateForumPostTagAsync(string name, DiscordEm
UnicodeEmojiString = emoji?.Id == null || emoji?.Id == 0 ? emoji?.Name ?? null : null,
Moderated = moderated,
Id = null
}).ToList(), Optional.None, Optional.None, Optional.None, Optional.None, Optional.None, null, Optional.None, reason, Optional.None).ConfigureAwait(false);
}).ToList(), Optional.None, Optional.None, Optional.None, Optional.None, Optional.None, Optional.None, null, Optional.None, reason).ConfigureAwait(false);

/// <summary>
/// Deletes a forum channel tag.
Expand All @@ -1216,9 +1216,9 @@ public async Task<DiscordChannel> CreateForumPostTagAsync(string name, DiscordEm
/// <exception cref="BadRequestException">Thrown when an invalid parameter was provided.</exception>
/// <exception cref="ServerErrorException">Thrown when Discord is unable to process the request.</exception>
public async Task<DiscordChannel> DeleteForumPostTag(ulong id, string reason = null)
=> this.Type != ChannelType.Forum ? throw new NotSupportedException("Channel needs to be type of Forum") : await this.Discord.ApiClient.ModifyForumChannelAsync(this.Id, null, null, Optional.None, Optional.None, null, Optional.None, this.InternalAvailableTags?.Where(x => x.Id != id)?.ToList(), Optional.None, Optional.None, Optional.None, Optional.None, Optional.None, null, Optional.None, reason, Optional.None).ConfigureAwait(false);
=> this.Type != ChannelType.Forum ? throw new NotSupportedException("Channel needs to be type of Forum") : await this.Discord.ApiClient.ModifyForumChannelAsync(this.Id, null, null, Optional.None, Optional.None, null, Optional.None, this.InternalAvailableTags?.Where(x => x.Id != id)?.ToList(), Optional.None, Optional.None, Optional.None, Optional.None, Optional.None, Optional.None, null, Optional.None, reason).ConfigureAwait(false);

#endregion
#endregion

/// <summary>
/// Adds a channel permission overwrite for specified role.
Expand Down Expand Up @@ -1463,7 +1463,7 @@ public Permissions PermissionsFor(DiscordMember mbr)
? $"Channel {this.Name} ({this.Id})"
: $"Channel {this.Id}";

#endregion
#endregion

/// <summary>
/// Checks whether this <see cref="DiscordChannel"/> is equal to another object.
Expand Down
4 changes: 2 additions & 2 deletions DisCatSharp/Entities/Guild/ThreadAndForum/ForumPostTag.cs
Expand Up @@ -96,7 +96,7 @@ public async Task<ForumPostTag> ModifyAsync(Action<ForumPostTagEditModel> action
Moderated = mdl.Moderated.HasValue ? mdl.Moderated.Value : this.Moderated,
Name = mdl.Name.HasValue ? mdl.Name.Value : this.Name,
UnicodeEmojiString = mdl.Emoji.HasValue ? mdl.Emoji.Value.Name : this.UnicodeEmojiString
}).ToList(), null, null, null, null, null, null, null, mdl.AuditLogReason, Optional.None);
}).ToList(), null, null, null, null, null, null, null, null, mdl.AuditLogReason);
return res.InternalAvailableTags.First(x => x.Id == this.Id);
}

Expand All @@ -105,7 +105,7 @@ public async Task<ForumPostTag> ModifyAsync(Action<ForumPostTagEditModel> action
/// </summary>
/// <exception cref="NotImplementedException">This method is currently not implemented.</exception>
public Task DeleteAsync(string reason = null)
=> this.Discord.ApiClient.ModifyForumChannelAsync(this.ChannelId, null, null, Optional.None, Optional.None, null, Optional.None, this.Channel.InternalAvailableTags.Where(x => x.Id != this.Id).ToList(), Optional.None, Optional.None, Optional.None, Optional.None, Optional.None, null, Optional.None, reason, Optional.None);
=> this.Discord.ApiClient.ModifyForumChannelAsync(this.ChannelId, null, null, Optional.None, Optional.None, null, Optional.None, this.Channel.InternalAvailableTags.Where(x => x.Id != this.Id).ToList(), Optional.None, Optional.None, Optional.None, Optional.None, Optional.None, Optional.None, null, Optional.None, reason);

/// <summary>
/// Checks whether this <see cref="ForumPostTag"/> is equal to another object.
Expand Down

0 comments on commit a9342da

Please sign in to comment.