Add the source code
This commit is contained in:
		
							
								
								
									
										32
									
								
								src/deploy-commands.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								src/deploy-commands.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| import { REST, Routes, SlashCommandBuilder } from 'discord.js'; | ||||
| import { env } from './config/env.js'; | ||||
| import * as setup from './commands/setup.js'; | ||||
| import * as leaderboard from './commands/leaderboard.js'; | ||||
| import * as profile from './commands/profile.js'; | ||||
| import * as resetmemory from './commands/resetmemory.js'; | ||||
| import { banData, kickData, timeoutData } from './commands/moderation.js'; | ||||
|  | ||||
| async function main() { | ||||
|   const commands = [ | ||||
|     (setup.data as SlashCommandBuilder).toJSON(), | ||||
|     (leaderboard.data as SlashCommandBuilder).toJSON(), | ||||
|     (profile.data as SlashCommandBuilder).toJSON(), | ||||
|     (resetmemory.data as SlashCommandBuilder).toJSON(), | ||||
|     banData.toJSON(), | ||||
|     kickData.toJSON(), | ||||
|     timeoutData.toJSON() | ||||
|   ]; | ||||
|  | ||||
|   const rest = new REST({ version: '10' }).setToken(env.discordToken); | ||||
|  | ||||
|   await rest.put(Routes.applicationCommands(env.discordClientId), { body: commands }); | ||||
|   // You can replace with Routes.applicationGuildCommands for quicker iteration per guild | ||||
|   console.log('Commands deployed.'); | ||||
| } | ||||
|  | ||||
| main().catch((e) => { | ||||
|   console.error(e); | ||||
|   process.exit(1); | ||||
| }); | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user