Convert unnecessary async functions

This commit is contained in:
Essem 2022-09-10 23:18:44 -05:00
parent 239d69d6d3
commit 20f4849fee
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
8 changed files with 19 additions and 14 deletions

View file

@ -74,7 +74,7 @@ export async function load(client, command, soundStatus, slashReload = false) {
return commandName;
}
export async function update() {
export function update() {
const commandArray = [];
const privateCommandArray = [];
const merged = new Map([...commands, ...messageCommands]);
@ -118,7 +118,7 @@ export async function update() {
}
export async function send(bot) {
const commandArray = await update();
const commandArray = update();
log("info", "Sending application command data to Discord...");
let cmdArray = commandArray.main;
if (process.env.ADMIN_SERVER && process.env.ADMIN_SERVER !== "") {

View file

@ -10,7 +10,7 @@ export let categories = categoryTemplate;
export let generated = false;
export async function generateList() {
export function generateList() {
categories = categoryTemplate;
for (const [command] of commands) {
const category = info.get(command).category;

View file

@ -13,9 +13,7 @@ const optionalReplace = (token) => {
};
// clean(text) to clean message of any private info or mentions
export async function clean(text) {
if (text?.constructor?.name == "Promise")
text = await text;
export function clean(text) {
if (typeof text !== "string")
text = util.inspect(text, { depth: 1 });

View file

@ -31,7 +31,7 @@ export async function checkStatus() {
return status;
}
export async function connect(client) {
export function connect(client) {
manager = new Shoukaku(new Connectors.Eris(client), nodes, { moveOnDisconnect: true, resume: true, reconnectInterval: 500, reconnectTries: 1 });
client.emit("ready"); // workaround
manager.on("error", (node, error) => {
@ -71,7 +71,7 @@ export async function play(client, sound, options, music = false) {
if (!node) {
const status = await checkStatus();
if (!status) {
await connect(client);
connect(client);
node = manager.getNode();
}
}