public class Permissions
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
ADD_OP |
|
static java.lang.String |
GET_OPS |
|
static java.lang.String |
OP_REQUIRED_MESSAGE |
|
static java.lang.String |
REMOVE_OPS |
Modifier and Type | Method | Description |
---|---|---|
java.lang.Boolean |
addOp(java.lang.String userId) |
Adds the specified user to the Ops list and DB table.
|
java.util.ArrayList<java.lang.String> |
getOps() |
|
static Permissions |
getPermissions() |
|
boolean |
isOp(java.lang.String userId) |
Used to check the permissions of a user.
|
boolean |
isOp(net.dv8tion.jda.core.entities.User user) |
Used to check the permissions of a user.
|
boolean |
removeOp(java.lang.String userId) |
Removes the specified user from the Ops list and DB table.
|
void |
setBotAsOp(net.dv8tion.jda.core.entities.SelfUser bot) |
Used to set the bot as an OP after the jDiscord API has connected and acquired
the login account's ID.
|
static void |
setupPermissions() |
public static final java.lang.String ADD_OP
public static final java.lang.String GET_OPS
public static final java.lang.String REMOVE_OPS
public static final java.lang.String OP_REQUIRED_MESSAGE
public static void setupPermissions()
public static Permissions getPermissions()
public void setBotAsOp(net.dv8tion.jda.core.entities.SelfUser bot)
bot
- The User object representing the currently logged in account.public java.lang.Boolean addOp(java.lang.String userId) throws java.sql.SQLException
userId
- The Discord ID of the user.java.sql.SQLException
- in case of sql update failingpublic boolean removeOp(java.lang.String userId) throws java.sql.SQLException
userId
- The Discord ID of the user.java.sql.SQLException
- in case of sql update failingpublic java.util.ArrayList<java.lang.String> getOps()
public boolean isOp(net.dv8tion.jda.core.entities.User user)
user
- The GroupUser to check the permission level of.public boolean isOp(java.lang.String userId)
userId
- The Discord ID of the user.