nickstarform / Star-Bot

Discord Bot written in Java using JDA, soon to be python
GNU General Public License v3.0
2 stars 0 forks source link

Role color #26

Closed nickstarform closed 6 years ago

nickstarform commented 6 years ago

Add ability for users to decide their own role color. Option first needs to be enabled first by someone with >= manage roles perms

nickstarform commented 6 years ago

!enablecolor // command for manager

should verify/create a attribute in the Guild.properties with the roles ColorRoleStatus = true ColorRoles=list

nickstarform commented 6 years ago

!disablecolor // removes ability and resets list by disablerole from the color roles (doesnt delete)

ColorRoleStatus = false ColorRoles= !disablecolor delete add option to delete the roles

nickstarform commented 6 years ago

!color // allows the user to manage color roles

!color #hex // creates the role and puts user in it or just puts user in it !color showall //shows all current color schemes with swatches !color random // cho0ses a random color and assigns !color remove #hex // users with manage role perms can remove this color role altogether !color remove // clears the user from color roles in their name make sure user is only ever in one color at a time

nickstarform commented 6 years ago

color roles will have 0 permissions (default) so any permissions will override this.

nickstarform commented 6 years ago

GUILDMANAGER http://home.dv8tion.net:8080/job/JDA/lastSuccessfulBuild/javadoc/net/dv8tion/jda/core/managers/GuildController.html#modifyRolePositions-boolean-

ROLE MANAGER http://home.dv8tion.net:8080/job/JDA/lastSuccessfulBuild/javadoc/net/dv8tion/jda/core/entities/Role.html#getPermissionsRaw--

HEX MANAGER https://javamex.com/tutorials/conversion/decimal_hexadecimal.shtml

DISCORD PERMS https://discordapp.com/developers/docs/topics/permissions

nickstarform commented 6 years ago

This was much more difficult than I thought but has been completed

define a color template role will remove all color roles from member before applying a new role tries to prune roles if they have no members

Things to note: when enabling color via colorenable templaterole the template role must be ABOVE the highest positioned COLORED role. If anything is higher and has non-default colors, the color role wont show for those users in that role.