Properly log Lavalink connection errors, fix large file fallback message, actions changes

This commit is contained in:
Essem 2022-10-02 13:28:43 -05:00
parent b9f1ccc39e
commit cfb5cb506f
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
4 changed files with 10 additions and 18 deletions

View file

@ -17,8 +17,6 @@ jobs:
uses: actions/checkout@v1
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.2
with:
cache: 'pnpm'
- name: Setup pnpm
uses: pnpm/action-setup@v2.2.2
with:
@ -33,23 +31,17 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
path-type: inherit
update: true
install: git mingw-w64-x86_64-cc mingw-w64-x86_64-libvips mingw-w64-x86_64-imagemagick
- name: Setup Scoop
uses: MinoruSekine/setup-scoop@v1
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.2
with:
cache: 'pnpm'
- name: Setup pnpm
uses: pnpm/action-setup@v2.2.2
with:
version: 7
- name: Install Dependencies
run: scoop install libvips imagemagick
- name: Build
shell: msys2 {0}
run: $PNPM_HOME/pnpm install --config.strict-peer-dependencies=false && $PNPM_HOME/pnpm run build
darwin:
@ -59,8 +51,6 @@ jobs:
uses: actions/checkout@v1
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.2
with:
cache: 'pnpm'
- name: Setup pnpm
uses: pnpm/action-setup@v2.2.2
with:

View file

@ -59,7 +59,7 @@ export default async (client, interaction) => {
} else if (error.toString().includes("Timed out")) {
await interaction[replyMethod]({ content: "The request timed out before I could download that image. Try uploading your image somewhere else or reducing its size.", flags: 64 });
} else {
logger.error(`Error occurred with application command ${command} with arguments ${JSON.stringify(interaction.data.options)}: ${error.stack || error}`);
logger.error(`Error occurred with application command ${command} with arguments ${JSON.stringify(interaction.data.optionsArray)}: ${error.stack || error}`);
try {
let err = error;
if (error?.constructor?.name == "Promise") err = await error;

View file

@ -140,7 +140,9 @@ export default async (client, message) => {
if (process.env.TEMPDIR && process.env.TEMPDIR !== "") {
await upload(client, result, message);
} else {
await client.rest.channels.createMessage(message.channelID, "The resulting image was more than 8MB in size, so I can't upload it.");
await client.rest.channels.createMessage(message.channelID, {
content: "The resulting image was more than 8MB in size, so I can't upload it."
});
}
} else {
await client.rest.channels.createMessage(message.channelID, Object.assign({

View file

@ -22,8 +22,8 @@ export async function checkStatus() {
try {
const response = await request(`http://${node.url}/version`, { headers: { authorization: node.auth } }).then(res => res.body.text());
if (response) newNodes.push(node);
} catch {
logger.error(`Failed to get status of Lavalink node ${node.url}.`);
} catch (e) {
logger.error(`Failed to get status of Lavalink node ${node.url}: ${e}`);
}
}
nodes = newNodes;