Skip to content

Commit 8b9eed3

Browse files
authored
[Fix] Incorrect casts in the legacy component builder
1 parent 87c1461 commit 8b9eed3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Discord.Net.Core/Entities/Interactions/MessageComponents/Builders/ComponentBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ internal void AddComponent(IMessageComponent component, int row)
8787
/// <returns>The current builder.</returns>
8888
public ComponentBuilder RemoveComponentsOfType(ComponentType t)
8989
{
90-
this.ActionRows.ForEach(ar => ar.Components.RemoveAll(c => c.Type == t));
90+
ActionRows.ForEach(ar => ar.Components.RemoveAll(c => c.Type == t));
9191
return this;
9292
}
9393

@@ -98,7 +98,7 @@ public ComponentBuilder RemoveComponentsOfType(ComponentType t)
9898
/// <returns>The current builder.</returns>
9999
public ComponentBuilder RemoveComponent(string customId)
100100
{
101-
this.ActionRows.ForEach(ar => ar.Components.RemoveAll(c => c is IInteractableComponent i && i.CustomId == customId));
101+
ActionRows.ForEach(ar => ar.Components.RemoveAll(c => c is IInteractableComponentBuilder i && i.CustomId == customId));
102102
return this;
103103
}
104104

@@ -109,7 +109,7 @@ public ComponentBuilder RemoveComponent(string customId)
109109
/// <returns>The current builder.</returns>
110110
public ComponentBuilder RemoveButtonByURL(string url)
111111
{
112-
this.ActionRows.ForEach(ar => ar.Components.RemoveAll(c => c is ButtonComponent b && b.Url == url));
112+
ActionRows.ForEach(ar => ar.Components.RemoveAll(c => c is ButtonBuilder b && b.Url == url));
113113
return this;
114114
}
115115

0 commit comments

Comments
 (0)