ralphkb / sentinel-tickets

Sentinel Tickets is a free and configurable open source discord ticket bot without watermarks or bloat.
https://sentineltickets.com
MIT License
35 stars 8 forks source link

bug permission #65

Closed MahdiTeaR closed 5 months ago

MahdiTeaR commented 5 months ago

When I open the ticket, all people have permission to see the ticket, from which part can fix this?

ralphkb commented 5 months ago

Hey, try checking the newly opened ticket channel for which roles have permissions to see the tickets. Unless you manually modified .js files, which you should never really do, it is impossible for the @everyone role to be allowed to see any tickets.

You can also try checking the audit log to see which permissions the bot allowed/disallowed when the ticket channel was created, make sure the bot has enough permissions and review your configuration. Those steps should guide you towards finding the cause of the issue and hopefully fixing it too.

You should check the support_role_ids part of the config of the ticket category that has this issue, if you have a member role and put it there by mistake then the bot might be giving them access to the ticket as per your configuration.

MahdiTeaR commented 5 months ago

Screenshot (76)

ralphkb commented 5 months ago

Impossible, check if other bots are doing this in the audit log or if you edited the interactionCreate.js file. The code for denying access to the @everyone role is intentionally hard coded so that users do not mess it up and end up with public ticket channels.

                permissionOverwrites: [
                  {
                    id: interaction.guild.id,
                    deny: [
                      PermissionFlagsBits.ViewChannel,
                      PermissionFlagsBits.SendMessages,
                    ],
                  },
MahdiTeaR commented 5 months ago

When I run the code on the Replit site, there is no problem with permission, but when we run the code in Visual Studio Code, there is a problem with everyone's permission.

ralphkb commented 5 months ago

Then you have the answer I think, check what files might be incorrect or outdated or modified in the environment where you run the bot. Specially replace the interactionCreate.js to get this fixed. As I pointed above, the lines of code that handle the @everyone permission are clearly correct in the file.

You can also find them here: https://github.com/ralphkb/sentinel-tickets/blob/main/events/interactionCreate.js#L2456