MiraWaNeko / DiscordIntegration

Communicate between Minecraft and Discord
https://discordintegration.net
GNU Affero General Public License v3.0
88 stars 42 forks source link

Additional Custom Commands don't work [1.12.2-3.0.5] #166

Closed kreezxil closed 5 years ago

kreezxil commented 5 years ago

Base informations

Minecraft version: 1.12.2-14.23.4.2760

DiscordIntegration version: 1.12.2-3.0.5

Server type and version: Forge/Spigot/Sponge Forge 1.12.2-14.23.4.2760

Link to pastebin with (censored) config: Optional https://pastebin.com/BxiHiesH

Expected behavior

new custom commands to work

Actual behavior

The demo provided commands discord, tps, online, list all work as intended. But the other ones I added do not and are completely ignored.

Steps to reproduce

Install version 3.0.5 and add your own commands to it. Also use Forge build 2760

MiraWaNeko commented 5 years ago

Suggestion received via DM
(formatting cleaned up for better overview)

Allow the mod to be completely configurable in-game as well.

Command Description Example Response
/discord custom add [name] [command] Add custom command /discord custom add kick /kick {ARG_1} Custom command kick added with '/kick {ARG_1}'
/discord custom modify [name] [command] Edit custom command /discord custom modify kick /kick {ARG_1} Custom command kick modified to '/kick {ARG_1}'
/discord custom enable [name] Enable custom command /discord custom enable kick Custom command kick enabled
/discord custom disable [name] Disable custom command /discord custom disable kick Custom command kick disabled
/discord custom addperm [name] [permission] Adds permission to custom command /discord custom disable addperm kick role:staff Added permission for 'staff' role to custom command kick
/discord custom delperm [name] [permission] Remove permission to custom command /discord custom disable delperm kick role:staff Removed permission for 'staff' role to custom command kick

Having this type of functionality removes the issues caused by editing json by hand and it allows you to tell everyone that fails at hand editing to use the internal method.

MiraWaNeko commented 5 years ago

Have you tried setting the permission to the user: type? Just to check if there's something wrong with the role: type permissions

kreezxil commented 5 years ago

Did you look at my paste to see if there was a glaring issue with my json syntax in regards to the mod?

kreezxil commented 5 years ago

Ok, the issue is when you try to use a named role like "role:staff" that doesn't work, but if you use the id of the role ie "role:0000000000000" that works.

Also the bot needs a way to expose the roleid of a role such that if issue maybe !roleid staff with spaces it would return 000000000000000. Because the method for Discord to reveal roleid's is not perfect. I use the tool from DiscordChat by ShadowFactsMC to reveal the roleid. That's also an open source and open licensed project, you could grab that code and then your mod is like totally awesome.

MiraWaNeko commented 5 years ago

Okay, good to know the cause behind the issue. Thanks for checking that.

I was about to suggest the built-in Developer Mode in Discord to get the IDs til I noticed, that I had no idea how to get the ID of a role.. We'd definitely need something for getting those

Mijago commented 5 years ago

You can get the ID of the role staff by typing \@staff in discord. This gives you something like this: <@267348412374694456>. The number is the role id.

This is less a DiscordIntegration bug but more a thing missing in the documentation (plus, a missing discord feature).

kreezxil commented 5 years ago

Markus the method you describe for getting a discord role id does not work if the discord role is composed of more than one word with spaces between those words.

On Tue, Oct 30, 2018 at 4:27 AM Markus notifications@github.com wrote:

Closed #166 https://github.com/Chikachi/DiscordIntegration/issues/166.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Chikachi/DiscordIntegration/issues/166#event-1934477828, or mute the thread https://github.com/notifications/unsubscribe-auth/ADs0iJpyN_K_FExEfKwJp-e5rQ8FoEwuks5uqBuKgaJpZM4W4220 .