1
- package com .kuuhaku .method ;
1
+ package com .github . ygimenez .method ;
2
2
3
- import com .kuuhaku .exception .EmptyPageCollectionException ;
4
- import com .kuuhaku .type .PageType ;
5
- import com .kuuhaku .listener .MessageListener ;
6
- import com .kuuhaku .model .Page ;
3
+ import com .github . ygimenez .exception .EmptyPageCollectionException ;
4
+ import com .github . ygimenez .type .PageType ;
5
+ import com .github . ygimenez .listener .MessageListener ;
6
+ import com .github . ygimenez .model .Page ;
7
7
import net .dv8tion .jda .api .JDA ;
8
8
import net .dv8tion .jda .api .entities .Member ;
9
9
import net .dv8tion .jda .api .entities .Message ;
21
21
import java .util .function .BiConsumer ;
22
22
import java .util .function .Consumer ;
23
23
24
- import static com .kuuhaku .type .Emote .*;
24
+ import static com .github . ygimenez .type .Emote .*;
25
25
26
26
public class Pages {
27
27
@@ -94,7 +94,7 @@ public void onMessageDelete(@Nonnull MessageDeleteEvent event) {
94
94
/**
95
95
* Adds menu-like buttons to the specified Message/MessageEmbed which will
96
96
* browse through a given Map of pages. You may specify one Page per button,
97
- * adding another button with an existing unicode will ovewrite the current
97
+ * adding another button with an existing unicode will overwrite the current
98
98
* button's Page. You must specify how long the listener will stay active before
99
99
* shutting down itself after a no-activity interval.
100
100
*
@@ -151,19 +151,19 @@ public void onMessageDelete(@Nonnull MessageDeleteEvent event) {
151
151
/**
152
152
* Adds buttons to the specified Message/MessageEmbed, with each executing a
153
153
* specific task on click. Each button's unicode must be unique, adding another
154
- * button with an existing unicode will ovewrite the current button's Runnable.
154
+ * button with an existing unicode will overwrite the current button's Runnable.
155
155
*
156
156
* @param api The bot's instantiated object.
157
157
* @param msg The message sent which will be buttoned.
158
- * @param buttons The bottons to be shown. The buttons are defined by a Map
158
+ * @param buttons The buttons to be shown. The buttons are defined by a Map
159
159
* containing emote unicodes as keys and BiConsumer<Member, Message> containing
160
160
* desired behavior as value.
161
161
* @param showCancelButton Should the cancel button be created automatically?
162
162
* @throws ErrorResponseException Thrown if the message no longer exists or
163
163
* cannot be acessed when triggering a
164
164
* GenericMessageReactionEvent
165
165
*/
166
- public static void buttonfy (JDA api , Message msg , Map <String , BiConsumer <Member , Message >> buttons , boolean showCancelButton ) throws ErrorResponseException {
166
+ public static void buttonize (JDA api , Message msg , Map <String , BiConsumer <Member , Message >> buttons , boolean showCancelButton ) throws ErrorResponseException {
167
167
buttons .keySet ().forEach (k -> msg .addReaction (k ).queue ());
168
168
if (!buttons .containsKey (CANCEL .getCode ()) && showCancelButton ) msg .addReaction (CANCEL .getCode ()).queue ();
169
169
api .addEventListener (new MessageListener () {
@@ -196,13 +196,13 @@ public void onMessageDelete(@Nonnull MessageDeleteEvent event) {
196
196
/**
197
197
* Adds buttons to the specified Message/MessageEmbed, with each executing a
198
198
* specific task on click. Each button's unicode must be unique, adding another
199
- * button with an existing unicode will ovewrite the current button's Runnable.
199
+ * button with an existing unicode will overwrite the current button's Runnable.
200
200
* You can specify the time in which the listener will automatically stop itself
201
201
* after a no-activity interval.
202
202
*
203
203
* @param api The bot's instantiated object.
204
204
* @param msg The message sent which will be buttoned.
205
- * @param buttons The bottons to be shown. The buttons are defined by a Map
205
+ * @param buttons The buttons to be shown. The buttons are defined by a Map
206
206
* containing emote unicodes as keys and BiConsumer<Member, Message> containing
207
207
* desired behavior as value.
208
208
* @param showCancelButton Should the cancel button be created automatically?
@@ -213,7 +213,7 @@ public void onMessageDelete(@Nonnull MessageDeleteEvent event) {
213
213
* cannot be acessed when triggering a
214
214
* GenericMessageReactionEvent
215
215
*/
216
- public static void buttonfy (JDA api , Message msg , Map <String , BiConsumer <Member , Message >> buttons , boolean showCancelButton , int time , TimeUnit unit )
216
+ public static void buttonize (JDA api , Message msg , Map <String , BiConsumer <Member , Message >> buttons , boolean showCancelButton , int time , TimeUnit unit )
217
217
throws ErrorResponseException {
218
218
buttons .keySet ().forEach (k -> msg .addReaction (k ).queue ());
219
219
if (!buttons .containsKey (CANCEL .getCode ()) && showCancelButton ) msg .addReaction (CANCEL .getCode ()).queue ();
0 commit comments