@@ -36,6 +36,7 @@ import { resourceInteraction } from './resource/index.js';
3636import { shitpostInteraction } from './shitpost/index.js' ;
3737// import { warn } from './warn/index.js';
3838import { whynoInteraction } from './whyno/index.js' ;
39+ import { repelInteraction } from './repel' ;
3940
4041export const guildCommands = new Map (
4142 [
@@ -50,8 +51,9 @@ export const guildCommands = new Map(
5051 whynoInteraction ,
5152 roleCommands ,
5253 setupCommands ,
54+ repelInteraction ,
5355 // warn // Not used atm
54- ] . map ( command => [ command . name , command ] )
56+ ] . map ( command => [ command . name , command ] ) ,
5557) ; // placeholder for now
5658
5759export const applicationCommands = new Collection <
@@ -88,7 +90,7 @@ const stripNullish = <T>(obj: T): T => {
8890 return Object . fromEntries (
8991 Object . entries ( obj )
9092 . map ( ( [ a , b ] ) => [ a , stripNullish ( b ) ] )
91- . filter ( ( [ , b ] ) => b != null )
93+ . filter ( ( [ , b ] ) => b != null ) ,
9294 ) as T ;
9395} ;
9496
@@ -121,7 +123,7 @@ export const registerCommands = async (client: Client): Promise<void> => {
121123 content : 'Something went wrong when trying to execute the command' ,
122124 } ) ;
123125 }
124- } )
126+ } ) ,
125127 ) ;
126128
127129 for ( const { onAttach } of applicationCommands . values ( ) ) {
@@ -152,7 +154,7 @@ export const registerCommands = async (client: Client): Promise<void> => {
152154 await addCommands (
153155 discordCommandsById ,
154156 applicationCommands ,
155- client . application . commands
157+ client . application . commands ,
156158 ) ;
157159
158160 console . log ( 'General Commands All Added' ) ;
@@ -170,14 +172,14 @@ async function addCommands(
170172 ApplicationCommand < { guild : GuildResolvable } >
171173 > ,
172174 commandDescriptions : Map < string , CommandDataWithHandler > ,
173- commandManager : ApplicationCommandManager | GuildApplicationCommandManager
175+ commandManager : ApplicationCommandManager | GuildApplicationCommandManager ,
174176) {
175177 const discordChatInputCommandsById = serverCommands . filter (
176- x => x . type === ApplicationCommandType . ChatInput
178+ x => x . type === ApplicationCommandType . ChatInput ,
177179 ) ;
178180
179181 const discordCommands = new Collection (
180- discordChatInputCommandsById . map ( value => [ value . name , value ] )
182+ discordChatInputCommandsById . map ( value => [ value . name , value ] ) ,
181183 ) ;
182184
183185 const validCommands = pipe <
@@ -188,22 +190,22 @@ async function addCommands(
188190 ( [ key , val ] : [ string , CommandDataWithHandler ] ) =>
189191 'guild' in commandManager && val . guildValidate
190192 ? val . guildValidate ( commandManager . guild )
191- : true
193+ : true ,
192194 ) ,
193195 map ( ( [ key ] ) => key ) ,
194196 ] ) ;
195197
196198 const newCommands = difference (
197199 validCommands ( commandDescriptions ) ,
198- discordCommands . keys ( )
200+ discordCommands . keys ( ) ,
199201 ) ;
200202 const existingCommands = intersection (
201203 validCommands ( commandDescriptions ) ,
202- discordCommands . keys ( )
204+ discordCommands . keys ( ) ,
203205 ) ;
204206 const deletedCommands = difference < string > (
205207 discordCommands . keys ( ) ,
206- validCommands ( commandDescriptions )
208+ validCommands ( commandDescriptions ) ,
207209 ) ;
208210
209211 // const new = await client.application.commands.create()
@@ -213,15 +215,15 @@ async function addCommands(
213215 editExistingCommands (
214216 commandDescriptions ,
215217 commandManager ,
216- discordCommands
218+ discordCommands ,
217219 ) ( existingCommands ) ,
218- deleteRemovedCommands ( commandManager , discordCommands ) ( deletedCommands )
219- )
220+ deleteRemovedCommands ( commandManager , discordCommands ) ( deletedCommands ) ,
221+ ) ,
220222 ) ;
221223}
222224
223225function getDestination (
224- commandManager : ApplicationCommandManager | GuildApplicationCommandManager
226+ commandManager : ApplicationCommandManager | GuildApplicationCommandManager ,
225227) {
226228 return 'guild' in commandManager
227229 ? `Guild: ${ commandManager . guild . name } `
@@ -230,7 +232,7 @@ function getDestination(
230232
231233function createNewCommands (
232234 cmdDescriptions : Map < string , CommandDataWithHandler > ,
233- cmdMgr : ApplicationCommandManager | GuildApplicationCommandManager
235+ cmdMgr : ApplicationCommandManager | GuildApplicationCommandManager ,
234236) {
235237 const destination = getDestination ( cmdMgr ) ;
236238 return map ( async ( name : string ) => {
@@ -248,7 +250,7 @@ function createNewCommands(
248250function editExistingCommands (
249251 cmdDescriptions : Map < string , CommandDataWithHandler > ,
250252 cmdMgr : ApplicationCommandManager | GuildApplicationCommandManager ,
251- existingCommands : Map < string , ApplicationCommand >
253+ existingCommands : Map < string , ApplicationCommand > ,
252254) {
253255 const destination = getDestination ( cmdMgr ) ;
254256 return map ( ( name : string ) => {
@@ -260,7 +262,7 @@ function editExistingCommands(
260262 if (
261263 ! isEqual (
262264 getRelevantCmdProperties ( cmd ) ,
263- getRelevantCmdProperties ( existing )
265+ getRelevantCmdProperties ( existing ) ,
264266 )
265267 ) {
266268 console . info ( `Updating ${ name } for ${ destination } ` ) ;
@@ -272,7 +274,7 @@ function editExistingCommands(
272274
273275function deleteRemovedCommands (
274276 cmdMgr : ApplicationCommandManager | GuildApplicationCommandManager ,
275- existingCommands : Map < string , ApplicationCommand >
277+ existingCommands : Map < string , ApplicationCommand > ,
276278) {
277279 const destination = getDestination ( cmdMgr ) ;
278280 return map ( async ( name : string ) => {
0 commit comments