Skip to content

Commit

Permalink
Fixed rest api
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorenzo0111 committed Apr 28, 2022
1 parent 88c1ac9 commit b7e0c5c
Show file tree
Hide file tree
Showing 2 changed files with 181 additions and 145 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if (bot.config.public) {
.addChannelType(ChannelType.GuildText)).toJSON());
}

bot.rest = new REST({ version: '9' }).setToken(bot.config.token);
const rest = new REST({ version: '9' }).setToken(bot.config.token);

bot.on('ready',() => {
bot.logger.info(`Logged in as ${bot.user.tag}.`)
Expand All @@ -69,7 +69,7 @@ bot.on('ready',() => {
(async () => {
bot.guilds.cache.forEach(guild => {
try {
bot.rest.put(
rest.put(
Routes.applicationGuildCommands(bot.user.id, guild.id),
{ body: bot.commands },
);
Expand Down
Loading

0 comments on commit b7e0c5c

Please sign in to comment.