public abstract static class Menu.Builder<T extends Menu.Builder<T,V>,V extends Menu>
extends java.lang.Object
Menu
.
Conventionally, implementations of Menu should have a static nested class called
Builder
, which extends this superclass:
public class MyMenu extends Menu
{
// Menu Code
public static class Builder extends Menu.Builder<Builder, MyMenu>
{
// Builder Code
}
}
MenuBuilder
.embeds
, there
is no bias or advantage of implementing a custom Menu as a message without an embed.Modifier and Type | Field and Description |
---|---|
protected java.util.Set<net.dv8tion.jda.core.entities.Role> |
roles |
protected long |
timeout |
protected java.util.concurrent.TimeUnit |
unit |
protected java.util.Set<net.dv8tion.jda.core.entities.User> |
users |
protected EventWaiter |
waiter |
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
T |
addRoles(net.dv8tion.jda.core.entities.Role... roles)
Adds
Role s that are allowed to use the
Menu that will be built. |
T |
addUsers(net.dv8tion.jda.core.entities.User... users)
Adds
User s that are allowed to use the
Menu that will be built. |
abstract V |
build()
Builds the
Menu corresponding to
this Menu.Builder . |
T |
setEventWaiter(EventWaiter waiter)
Sets the
EventWaiter
that will do Menu operations. |
T |
setRoles(net.dv8tion.jda.core.entities.Role... roles)
Sets
Role s that are allowed to use the
Menu that will be built. |
T |
setTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
Sets the timeout that the
Menu should
stay available. |
T |
setUsers(net.dv8tion.jda.core.entities.User... users)
Sets
User s that are allowed to use the
Menu that will be built. |
protected EventWaiter waiter
protected java.util.Set<net.dv8tion.jda.core.entities.User> users
protected java.util.Set<net.dv8tion.jda.core.entities.Role> roles
protected long timeout
protected java.util.concurrent.TimeUnit unit
public abstract V build()
Menu
corresponding to
this Menu.Builder
.
Menu.Builder
.public final T setEventWaiter(EventWaiter waiter)
EventWaiter
that will do Menu
operations.
NOTE: All Menus will only work with an EventWaiter set!
Not setting an EventWaiter means the Menu will not work.
waiter
- The EventWaiterpublic final T addUsers(net.dv8tion.jda.core.entities.User... users)
User
s that are allowed to use the
Menu
that will be built.users
- The Users allowed to use the Menupublic final T setUsers(net.dv8tion.jda.core.entities.User... users)
User
s that are allowed to use the
Menu
that will be built.
users
- The Users allowed to use the Menupublic final T addRoles(net.dv8tion.jda.core.entities.Role... roles)
Role
s that are allowed to use the
Menu
that will be built.roles
- The Roles allowed to use the Menupublic final T setRoles(net.dv8tion.jda.core.entities.Role... roles)
Role
s that are allowed to use the
Menu
that will be built.
roles
- The Roles allowed to use the Menupublic final T setTimeout(long timeout, java.util.concurrent.TimeUnit unit)
Menu
should
stay available.
After this has expired, the a final action in the form of a
Runnable
may execute.
timeout
- The amount of time for the Menu to stay availableunit
- The TimeUnit
for the timeout