Properly log Lavalink connection errors, fix large file fallback message, actions changes
This commit is contained in:
parent
b9f1ccc39e
commit
cfb5cb506f
4 changed files with 10 additions and 18 deletions
18
.github/workflows/build.yml
vendored
18
.github/workflows/build.yml
vendored
|
@ -17,8 +17,6 @@ jobs:
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
- name: Setup Node.js environment
|
- name: Setup Node.js environment
|
||||||
uses: actions/setup-node@v2.1.2
|
uses: actions/setup-node@v2.1.2
|
||||||
with:
|
|
||||||
cache: 'pnpm'
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v2.2.2
|
uses: pnpm/action-setup@v2.2.2
|
||||||
with:
|
with:
|
||||||
|
@ -33,23 +31,17 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
- name: Setup MSYS2
|
- name: Setup Scoop
|
||||||
uses: msys2/setup-msys2@v2
|
uses: MinoruSekine/setup-scoop@v1
|
||||||
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 Node.js environment
|
- name: Setup Node.js environment
|
||||||
uses: actions/setup-node@v2.1.2
|
uses: actions/setup-node@v2.1.2
|
||||||
with:
|
|
||||||
cache: 'pnpm'
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v2.2.2
|
uses: pnpm/action-setup@v2.2.2
|
||||||
with:
|
with:
|
||||||
version: 7
|
version: 7
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: scoop install libvips imagemagick
|
||||||
- name: Build
|
- name: Build
|
||||||
shell: msys2 {0}
|
|
||||||
run: $PNPM_HOME/pnpm install --config.strict-peer-dependencies=false && $PNPM_HOME/pnpm run build
|
run: $PNPM_HOME/pnpm install --config.strict-peer-dependencies=false && $PNPM_HOME/pnpm run build
|
||||||
|
|
||||||
darwin:
|
darwin:
|
||||||
|
@ -59,8 +51,6 @@ jobs:
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
- name: Setup Node.js environment
|
- name: Setup Node.js environment
|
||||||
uses: actions/setup-node@v2.1.2
|
uses: actions/setup-node@v2.1.2
|
||||||
with:
|
|
||||||
cache: 'pnpm'
|
|
||||||
- name: Setup pnpm
|
- name: Setup pnpm
|
||||||
uses: pnpm/action-setup@v2.2.2
|
uses: pnpm/action-setup@v2.2.2
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -59,7 +59,7 @@ export default async (client, interaction) => {
|
||||||
} else if (error.toString().includes("Timed out")) {
|
} 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 });
|
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 {
|
} 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 {
|
try {
|
||||||
let err = error;
|
let err = error;
|
||||||
if (error?.constructor?.name == "Promise") err = await error;
|
if (error?.constructor?.name == "Promise") err = await error;
|
||||||
|
|
|
@ -140,7 +140,9 @@ export default async (client, message) => {
|
||||||
if (process.env.TEMPDIR && process.env.TEMPDIR !== "") {
|
if (process.env.TEMPDIR && process.env.TEMPDIR !== "") {
|
||||||
await upload(client, result, message);
|
await upload(client, result, message);
|
||||||
} else {
|
} 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 {
|
} else {
|
||||||
await client.rest.channels.createMessage(message.channelID, Object.assign({
|
await client.rest.channels.createMessage(message.channelID, Object.assign({
|
||||||
|
|
|
@ -22,8 +22,8 @@ export async function checkStatus() {
|
||||||
try {
|
try {
|
||||||
const response = await request(`http://${node.url}/version`, { headers: { authorization: node.auth } }).then(res => res.body.text());
|
const response = await request(`http://${node.url}/version`, { headers: { authorization: node.auth } }).then(res => res.body.text());
|
||||||
if (response) newNodes.push(node);
|
if (response) newNodes.push(node);
|
||||||
} catch {
|
} catch (e) {
|
||||||
logger.error(`Failed to get status of Lavalink node ${node.url}.`);
|
logger.error(`Failed to get status of Lavalink node ${node.url}: ${e}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nodes = newNodes;
|
nodes = newNodes;
|
||||||
|
|
Loading…
Reference in a new issue