DiscordSRV

DiscordSRV

86.8k Downloads

Chat permission problem between DiscordSRV and Towny

JoshJames04 opened this issue ยท 6 comments

commented

Hello! I was asked to make a ticket to discuss this further - I'm known as Wizeguy11 on discord.

Androkai asked:

Can you tell me if it's possible to toggle message receiving for channels you have permission for?

Simple answer - no.

Complex answer - Yes, there is a feature to be able to do this. Towny uses /join {chat name} and /leave {chat name} to in effect 'watch' and 'unwatch' chats, respectively. Not quite sure whether this is correct on the Towny dev's part, but the join command seems to just give a message saying you're already watching the chat and the leave command, well, doesn't actually let you unwatch the chat like it's supposed to do. Which, I think is quite strange. It's almost as if once you have the chat permission, you can't remove that by yourself.

Hopefully, we can discuss this further and try to find an optimal solution in the end of things.

commented

This sounds like something that should be sent to Towny, since those commands are for Towny, and from what I gather don't work in any capacity. Unless the issues are only with Discord messages, this would be a Towny side thing

commented

Androkai asked me to keep him updated - I'm currently discussing this issue with both the discordSRV team and the towny team

commented

He also said to make a ticket to discuss this further

commented

As is, if the issue isn't only with the Discord side of things, there really isn't much to be discussed on our side

commented

Aye, I was only doing as I was asked to do

commented

I meant a ticket in the TownyChat bug tracker, not ours, since it has to be discussed with the TownyChat developers. ๐Ÿ˜… Sorry if that was not clear.

Regarding the message you send me from the TownyChat developers:

One thing that discordsrv could do to make this a ton easier is to use the player.hasPermission(channel.getPermission()), if their API can work with that. (Instead of channel.isPresent(playername))

We can implement this but this will prevent channel switching with the /join <channel> and /leave <channel> commands to work. I mean that's why the TownyChat API has a channel.isPresent(playername) method. Without meaning to offend anyone, this advice sounds like it comes from a novice programmer who has no idea how to fix the actual functionality and therefore resorts to such "hacks". For this reason, I would prefer to use the obvious API method originally created by someone with a clue and avoid this hack.