66 component_callback ,
77 slash_command ,
88 slash_option ,
9+ slash_permission
910)
1011from dis_snek .models .context import InteractionContext
1112from dis_snek .models .discord_objects .channel import GuildText
1415from dis_snek .models .enums import ButtonStyles
1516
1617from storage .nerf import Nerf
18+ from utils .config import BOT_DEV_ROLE
1719
1820from utils .embeds import NERF_GUN
21+ from utils .perms import ADMIN_ONLY , BOT_DEV_ONLY , NOT_EVERYBODY
1922
2023
2124class Nerfgun (Scale ):
@@ -32,9 +35,8 @@ async def on_ready(self):
3235 await self ._update_leaderboard ()
3336
3437 @slash_command (
35- name = "nerf" ,
36- sub_cmd_name = "setup" ,
37- sub_cmd_description = "Setup the Nerf Gun queue in a specified text channel"
38+ name = "nerf_setup" ,
39+ description = "Setup the Nerf Gun queue in a specified text channel"
3840 )
3941 @slash_option (
4042 "queuechannel" ,
@@ -48,6 +50,7 @@ async def on_ready(self):
4850 OptionTypes .CHANNEL ,
4951 required = True ,
5052 )
53+ @slash_permission (NOT_EVERYBODY , BOT_DEV_ONLY )
5154 async def nerf_setup (self , ctx : InteractionContext , queuechannel , boardchannel ):
5255 await ctx .defer ()
5356
@@ -100,10 +103,10 @@ async def _setup_leaderboard_channel(self, boardchannel):
100103 self .nerf .set_leaderboard_message (leaderboard_msg )
101104
102105 @slash_command (
103- name = "nerf" ,
104- sub_cmd_name = "next" ,
105- sub_cmd_description = "Call up the next individual in the queue"
106+ name = "nerf_next" ,
107+ description = "Call up the next individual in the queue"
106108 )
109+ @slash_permission (NOT_EVERYBODY , ADMIN_ONLY )
107110 async def nerf_next (self , ctx : InteractionContext ):
108111 if self .nerf .queue_is_empty ():
109112 await ctx .send ("Queue currently empty!" )
@@ -167,9 +170,8 @@ async def _update_queue(self):
167170 await self .nerf .queue_msg .edit (text )
168171
169172 @slash_command (
170- name = "nerf" ,
171- sub_cmd_name = "score" ,
172- sub_cmd_description = "Score a player"
173+ name = "nerf_score" ,
174+ description = "Score a player"
173175 )
174176 @slash_option (
175177 "score" ,
@@ -183,6 +185,7 @@ async def _update_queue(self):
183185 OptionTypes .USER ,
184186 required = False
185187 )
188+ @slash_permission (NOT_EVERYBODY , ADMIN_ONLY )
186189 async def nerf_score (self , ctx : InteractionContext , score , player = None ):
187190 await ctx .defer ()
188191
0 commit comments