|
2 | 2 | using Color_Chan.Discord.Commands.Attributes; |
3 | 3 | using Color_Chan.Discord.Commands.Attributes.ProvidedRequirements; |
4 | 4 | using Color_Chan.Discord.Commands.MessageBuilders; |
| 5 | +using Color_Chan.Discord.Commands.MessageBuilders.Components; |
5 | 6 | using Color_Chan.Discord.Commands.Modules; |
6 | 7 | using Color_Chan.Discord.Core.Common.API.DataModels; |
7 | 8 | using Color_Chan.Discord.Core.Common.Models; |
@@ -123,26 +124,70 @@ private IDiscordEmbed GetHelpPageBuilder(int pageNum) |
123 | 124 |
|
124 | 125 | public static readonly IDiscordComponent ButtonsNoBack = |
125 | 126 | new ActionRowComponentBuilder() |
126 | | - .WithButton("Previous", DiscordButtonStyle.Primary, $"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}previous", disabled: true) |
127 | | - .WithButton("Next", DiscordButtonStyle.Primary, $"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}next") |
| 127 | + .WithSubComponent( |
| 128 | + new ButtonComponentBuilder() |
| 129 | + .WithLabel("Previous") |
| 130 | + .WithStyle(DiscordButtonStyle.Primary) |
| 131 | + .WithCustomId($"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}previous") |
| 132 | + .WithDisabled(true) |
| 133 | + ) |
| 134 | + .WithSubComponent( |
| 135 | + new ButtonComponentBuilder() |
| 136 | + .WithLabel("Next") |
| 137 | + .WithStyle(DiscordButtonStyle.Primary) |
| 138 | + .WithCustomId($"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}next") |
| 139 | + ) |
128 | 140 | .Build(); |
129 | 141 |
|
130 | | - public static readonly IDiscordComponent Buttons = |
| 142 | + private static readonly IDiscordComponent Buttons = |
131 | 143 | new ActionRowComponentBuilder() |
132 | | - .WithButton("Previous", DiscordButtonStyle.Primary, $"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}previous") |
133 | | - .WithButton("Next", DiscordButtonStyle.Primary, $"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}next") |
| 144 | + .WithSubComponent( |
| 145 | + new ButtonComponentBuilder() |
| 146 | + .WithLabel("Previous") |
| 147 | + .WithStyle(DiscordButtonStyle.Primary) |
| 148 | + .WithCustomId($"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}previous") |
| 149 | + ) |
| 150 | + .WithSubComponent( |
| 151 | + new ButtonComponentBuilder() |
| 152 | + .WithLabel("Next") |
| 153 | + .WithStyle(DiscordButtonStyle.Primary) |
| 154 | + .WithCustomId($"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}next") |
| 155 | + ) |
134 | 156 | .Build(); |
135 | 157 |
|
136 | | - public static readonly IDiscordComponent ButtonsNoNext = |
| 158 | + private static readonly IDiscordComponent ButtonsNoNext = |
137 | 159 | new ActionRowComponentBuilder() |
138 | | - .WithButton("Previous", DiscordButtonStyle.Primary, $"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}previous") |
139 | | - .WithButton("Next", DiscordButtonStyle.Primary, $"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}next", disabled: true) |
| 160 | + .WithSubComponent( |
| 161 | + new ButtonComponentBuilder() |
| 162 | + .WithLabel("Previous") |
| 163 | + .WithStyle(DiscordButtonStyle.Primary) |
| 164 | + .WithCustomId($"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}previous") |
| 165 | + ) |
| 166 | + .WithSubComponent( |
| 167 | + new ButtonComponentBuilder() |
| 168 | + .WithLabel("Next") |
| 169 | + .WithStyle(DiscordButtonStyle.Primary) |
| 170 | + .WithCustomId($"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}next") |
| 171 | + .WithDisabled(true) |
| 172 | + ) |
140 | 173 | .Build(); |
141 | 174 |
|
142 | | - public static readonly IDiscordComponent ButtonsAllDisabled = |
| 175 | + private static readonly IDiscordComponent ButtonsAllDisabled = |
143 | 176 | new ActionRowComponentBuilder() |
144 | | - .WithButton("Previous", DiscordButtonStyle.Primary, $"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}previous", disabled: true) |
145 | | - .WithButton("Next", DiscordButtonStyle.Primary, $"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}next", disabled: true) |
| 177 | + .WithSubComponent( |
| 178 | + new ButtonComponentBuilder() |
| 179 | + .WithLabel("Previous") |
| 180 | + .WithStyle(DiscordButtonStyle.Primary) |
| 181 | + .WithCustomId($"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}previous") |
| 182 | + .WithDisabled(true) |
| 183 | + ) |
| 184 | + .WithSubComponent( |
| 185 | + new ButtonComponentBuilder() |
| 186 | + .WithLabel("Next") |
| 187 | + .WithStyle(DiscordButtonStyle.Primary) |
| 188 | + .WithCustomId($"{ChangeHelpPageButtonId}{Constants.ArgsSeparator}next") |
| 189 | + .WithDisabled(true) |
| 190 | + ) |
146 | 191 | .Build(); |
147 | 192 |
|
148 | 193 | #endregion |
|
0 commit comments