-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-commands.js
More file actions
44 lines (38 loc) · 1.29 KB
/
Copy pathdeploy-commands.js
File metadata and controls
44 lines (38 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { config } from 'dotenv';
import { REST } from '@discordjs/rest';
import { Routes } from 'discord.js'
import { HelpCommand } from './commands/help.js';
import { CreateWalletCommand } from './commands/createwallet.js'
import { WithdrawCommand } from './commands/withdraw.js'
import { TipCommand } from './commands/tip.js'
import { BalanceCommand } from './commands/balance.js'
import { SetAddressCommand } from './commands/setaddress.js'
import { GetAddressCommand } from './commands/getaddress.js';
import { RPSCommand } from './commands/rps.js';
async function DeployCommands(client) {
config();
const TOKEN = process.env.TOKEN;
const CLIENT_ID = process.env.CLIENT_ID;
const rest = new REST({ version: '10' }).setToken(TOKEN);
const commands = [
HelpCommand,
CreateWalletCommand,
WithdrawCommand,
TipCommand,
BalanceCommand,
SetAddressCommand,
GetAddressCommand,
RPSCommand
];
try {
console.log('Started refreshing application (/) commands.');
Routes.applicationGuildCommands;
await rest.put(Routes.applicationCommands(CLIENT_ID), {
body: commands,
});
client.login(TOKEN);
} catch (err) {
console.log(err);
}
}
export default DeployCommands;