-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from BLACK4585/master
Added handlers for every Select Menu
- Loading branch information
Showing
13 changed files
with
251 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { readdirSync } from 'fs'; | ||
import chalk from 'chalk'; | ||
|
||
async function loadChannelSelectMenus(client) { | ||
client.channelSelectMenus.clear(); | ||
let files = 0; | ||
const channelSelectMenuFiles = readdirSync('./src/interactions/channelSelectMenus').filter(file => file.endsWith('.js')); | ||
if (!client.channelSelectMenus) return; | ||
for (let i = 0; i < channelSelectMenuFiles.length; i++) { | ||
const channelSelectMenu = await import(`../interactions/channelSelectMenus/${channelSelectMenuFiles[i]}?${Date.now()}`); | ||
await client.channelSelectMenus.set(channelSelectMenu.default.id, channelSelectMenu.default); | ||
console.log(chalk.greenBright(`[CHANNELSELECTMENU] Loaded ${(chalk.yellow(channelSelectMenuFiles[i]))} with channelSelectMenu ${(chalk.yellow(channelSelectMenu.default.id))}`)); | ||
files++; | ||
} | ||
const channelSelectMenuFolders = readdirSync('./src/interactions/channelSelectMenus', { withFileTypes: true }).filter(file => file.isDirectory()); | ||
if (!channelSelectMenuFolders) return; | ||
for (let i = 0; i < channelSelectMenuFolders.length; i++) { | ||
const channelSelectMenuFiles = readdirSync(`./src/interactions/channelSelectMenus/${channelSelectMenuFolders[i].name}`).filter(file => file.endsWith('.js')); | ||
for (let j = 0; j < channelSelectMenuFiles.length; j++) { | ||
const channelSelectMenu = await import(`../interactions/channelSelectMenus/${channelSelectMenuFolders[i].name}/${channelSelectMenuFiles[j]}?${Date.now()}`); | ||
await client.channelSelectMenus.set(channelSelectMenu.default.id, channelSelectMenu.default); | ||
console.log(chalk.greenBright(`[CHANNELSELECTMENU] Loaded ${(chalk.yellow(channelSelectMenuFiles[j]))} with channelSelectMenu ${(chalk.yellow(channelSelectMenu.default.id))}`)); | ||
files++; | ||
} | ||
} | ||
return files; | ||
} | ||
|
||
export default { loadChannelSelectMenus }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { readdirSync } from 'fs'; | ||
import chalk from 'chalk'; | ||
|
||
async function loadMentionableSelectMenus(client) { | ||
client.mentionableSelectMenus.clear(); | ||
let files = 0; | ||
const mentionableSelectMenuFiles = readdirSync('./src/interactions/mentionableSelectMenus').filter(file => file.endsWith('.js')); | ||
if (!client.mentionableSelectMenus) return; | ||
for (let i = 0; i < mentionableSelectMenuFiles.length; i++) { | ||
const mentionableSelectMenu = await import(`../interactions/mentionableSelectMenus/${mentionableSelectMenuFiles[i]}?${Date.now()}`); | ||
await client.mentionableSelectMenus.set(mentionableSelectMenu.default.id, mentionableSelectMenu.default); | ||
console.log(chalk.greenBright(`[MENTIONABLESELECTMENU] Loaded ${(chalk.yellow(mentionableSelectMenuFiles[i]))} with mentionableSelectMenu ${(chalk.yellow(mentionableSelectMenu.default.id))}`)); | ||
files++; | ||
} | ||
const mentionableSelectMenuFolders = readdirSync('./src/interactions/mentionableSelectMenus', { withFileTypes: true }).filter(file => file.isDirectory()); | ||
if (!mentionableSelectMenuFolders) return; | ||
for (let i = 0; i < mentionableSelectMenuFolders.length; i++) { | ||
const mentionableSelectMenuFiles = readdirSync(`./src/interactions/mentionableSelectMenus/${mentionableSelectMenuFolders[i].name}`).filter(file => file.endsWith('.js')); | ||
for (let j = 0; j < mentionableSelectMenuFiles.length; j++) { | ||
const mentionableSelectMenu = await import(`../interactions/mentionableSelectMenus/${mentionableSelectMenuFolders[i].name}/${mentionableSelectMenuFiles[j]}?${Date.now()}`); | ||
await client.mentionableSelectMenus.set(mentionableSelectMenu.default.id, mentionableSelectMenu.default); | ||
console.log(chalk.greenBright(`[MENTIONABLESELECTMENU] Loaded ${(chalk.yellow(mentionableSelectMenuFiles[j]))} with mentionableSelectMenu ${(chalk.yellow(mentionableSelectMenu.default.id))}`)); | ||
files++; | ||
} | ||
} | ||
return files; | ||
} | ||
|
||
export default { loadMentionableSelectMenus }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { readdirSync } from 'fs'; | ||
import chalk from 'chalk'; | ||
|
||
async function loadRoleSelectMenus(client) { | ||
client.roleSelectMenus.clear(); | ||
let files = 0; | ||
const roleSelectMenuFiles = readdirSync('./src/interactions/roleSelectMenus').filter(file => file.endsWith('.js')); | ||
if (!client.roleSelectMenus) return; | ||
for (let i = 0; i < roleSelectMenuFiles.length; i++) { | ||
const roleSelectMenu = await import(`../interactions/roleSelectMenus/${roleSelectMenuFiles[i]}?${Date.now()}`); | ||
await client.roleSelectMenus.set(roleSelectMenu.default.id, roleSelectMenu.default); | ||
console.log(chalk.greenBright(`[ROLESELECTMENU] Loaded ${(chalk.yellow(roleSelectMenuFiles[i]))} with roleSelectMenu ${(chalk.yellow(roleSelectMenu.default.id))}`)); | ||
files++; | ||
} | ||
const roleSelectMenuFolders = readdirSync('./src/interactions/roleSelectMenus', { withFileTypes: true }).filter(file => file.isDirectory()); | ||
if (!roleSelectMenuFolders) return; | ||
for (let i = 0; i < roleSelectMenuFolders.length; i++) { | ||
const roleSelectMenuFiles = readdirSync(`./src/interactions/roleSelectMenus/${roleSelectMenuFolders[i].name}`).filter(file => file.endsWith('.js')); | ||
for (let j = 0; j < roleSelectMenuFiles.length; j++) { | ||
const roleSelectMenu = await import(`../interactions/roleSelectMenus/${roleSelectMenuFolders[i].name}/${roleSelectMenuFiles[j]}?${Date.now()}`); | ||
await client.roleSelectMenus.set(roleSelectMenu.default.id, roleSelectMenu.default); | ||
console.log(chalk.greenBright(`[ROLESELECTMENU] Loaded ${(chalk.yellow(roleSelectMenuFiles[j]))} with roleSelectMenu ${(chalk.yellow(roleSelectMenu.default.id))}`)); | ||
files++; | ||
} | ||
} | ||
return files; | ||
} | ||
|
||
export default { loadRoleSelectMenus }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { readdirSync } from 'fs'; | ||
import chalk from 'chalk'; | ||
|
||
async function loadStringSelectMenus(client) { | ||
client.stringSelectMenus.clear(); | ||
let files = 0; | ||
const stringSelectMenuFiles = readdirSync('./src/interactions/stringSelectMenus').filter(file => file.endsWith('.js')); | ||
if (!client.stringSelectMenus) return; | ||
for (let i = 0; i < stringSelectMenuFiles.length; i++) { | ||
const stringSelectMenu = await import(`../interactions/stringSelectMenus/${stringSelectMenuFiles[i]}?${Date.now()}`); | ||
await client.stringSelectMenus.set(stringSelectMenu.default.id, stringSelectMenu.default); | ||
console.log(chalk.greenBright(`[STRINGSELECTMENU] Loaded ${(chalk.yellow(stringSelectMenuFiles[i]))} with stringSelectMenu ${(chalk.yellow(stringSelectMenu.default.id))}`)); | ||
files++; | ||
} | ||
const stringSelectMenuFolders = readdirSync('./src/interactions/stringSelectMenus', { withFileTypes: true }).filter(file => file.isDirectory()); | ||
if (!stringSelectMenuFolders) return; | ||
for (let i = 0; i < stringSelectMenuFolders.length; i++) { | ||
const stringSelectMenuFiles = readdirSync(`./src/interactions/stringSelectMenus/${stringSelectMenuFolders[i].name}`).filter(file => file.endsWith('.js')); | ||
for (let j = 0; j < stringSelectMenuFiles.length; j++) { | ||
const stringSelectMenu = await import(`../interactions/stringSelectMenus/${stringSelectMenuFolders[i].name}/${stringSelectMenuFiles[j]}?${Date.now()}`); | ||
await client.stringSelectMenus.set(stringSelectMenu.default.id, stringSelectMenu.default); | ||
console.log(chalk.greenBright(`[STRINGSELECTMENU] Loaded ${(chalk.yellow(stringSelectMenuFiles[j]))} with stringSelectMenu ${(chalk.yellow(stringSelectMenu.default.id))}`)); | ||
files++; | ||
} | ||
} | ||
return files; | ||
} | ||
|
||
export default { loadStringSelectMenus }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { readdirSync } from 'fs'; | ||
import chalk from 'chalk'; | ||
|
||
async function loadUserSelectMenus(client) { | ||
client.userSelectMenus.clear(); | ||
let files = 0; | ||
const userSelectMenuFiles = readdirSync('./src/interactions/userSelectMenus').filter(file => file.endsWith('.js')); | ||
if (!client.userSelectMenus) return; | ||
for (let i = 0; i < userSelectMenuFiles.length; i++) { | ||
const userSelectMenu = await import(`../interactions/userSelectMenus/${userSelectMenuFiles[i]}?${Date.now()}`); | ||
await client.userSelectMenus.set(userSelectMenu.default.id, userSelectMenu.default); | ||
console.log(chalk.greenBright(`[USERSELECTMENU] Loaded ${(chalk.yellow(userSelectMenuFiles[i]))} with userSelectMenu ${(chalk.yellow(userSelectMenu.default.id))}`)); | ||
files++; | ||
} | ||
const userSelectMenuFolders = readdirSync('./src/interactions/userSelectMenus', { withFileTypes: true }).filter(file => file.isDirectory()); | ||
if (!userSelectMenuFolders) return; | ||
for (let i = 0; i < userSelectMenuFolders.length; i++) { | ||
const userSelectMenuFiles = readdirSync(`./src/interactions/userSelectMenus/${userSelectMenuFolders[i].name}`).filter(file => file.endsWith('.js')); | ||
for (let j = 0; j < userSelectMenuFiles.length; j++) { | ||
const userSelectMenu = await import(`../interactions/userSelectMenus/${userSelectMenuFolders[i].name}/${userSelectMenuFiles[j]}?${Date.now()}`); | ||
await client.userSelectMenus.set(userSelectMenu.default.id, userSelectMenu.default); | ||
console.log(chalk.greenBright(`[USERSELECTMENU] Loaded ${(chalk.yellow(userSelectMenuFiles[j]))} with userSelectMenu ${(chalk.yellow(userSelectMenu.default.id))}`)); | ||
files++; | ||
} | ||
} | ||
return files; | ||
} | ||
|
||
export default { loadUserSelectMenus }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
id: 'test', | ||
async execute(client, interaction) { | ||
interaction.reply('Hello World!'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
id: 'test', | ||
async execute(client, interaction) { | ||
interaction.reply('Hello World!'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
id: 'test', | ||
async execute(client, interaction) { | ||
interaction.reply('Hello World!'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
id: 'test', | ||
async execute(client, interaction) { | ||
interaction.reply('Hello World!'); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default { | ||
id: 'test', | ||
async execute(client, interaction) { | ||
interaction.reply('Hello World!'); | ||
} | ||
}; |