Skip to content

Commit

Permalink
Merge branch 'master' into fix/router
Browse files Browse the repository at this point in the history
  • Loading branch information
rubyowo committed Jun 2, 2024
2 parents 2c6b176 + 4fa77d5 commit 1f943f2
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 45 deletions.
4 changes: 2 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"dotenv": "^4.0.0",
"emoji-regex": "^8.0.0",
"escape-string-regexp": "^1.0.5",
"express": "^4.17.0",
"express": "^4.19.2",
"fp-ts": "^2.0.1",
"humanize-duration": "^3.15.0",
"js-yaml": "^3.13.1",
Expand All @@ -52,7 +52,7 @@
"lodash": "^4.17.21",
"moment-timezone": "^0.5.21",
"multer": "^1.4.5-lts.1",
"mysql2": "^3.9.3",
"mysql2": "^3.9.8",
"parse-color": "^1.0.0",
"passport": "^0.6.0",
"passport-custom": "^1.0.5",
Expand Down
8 changes: 4 additions & 4 deletions backend/src/plugins/ModActions/commands/CasesUserCmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,24 @@ export const CasesUserCmd = modActionsCmd({
// Compact view (= regular message with a preview of each case)
const casesPlugin = pluginData.getPlugin(CasesPlugin);

const totalPages = Math.max(Math.ceil(cases.length / casesPerPage), 1);
const totalPages = Math.max(Math.ceil(casesToDisplay.length / casesPerPage), 1);
const prefix = getGuildPrefix(pluginData);

createPaginatedMessage(
pluginData.client,
msg.channel,
totalPages,
async (page) => {
const chunkedCases = chunkArray(cases, casesPerPage)[page - 1];
const chunkedCases = chunkArray(casesToDisplay, casesPerPage)[page - 1];
const lines = await asyncMap(chunkedCases, (c) => casesPlugin.getCaseSummary(c, true, msg.author.id));

const isLastPage = page === totalPages;
const firstCaseNum = (page - 1) * casesPerPage + 1;
const lastCaseNum = isLastPage ? cases.length : page * casesPerPage;
const lastCaseNum = isLastPage ? casesToDisplay.length : page * casesPerPage;
const title =
totalPages === 1
? `Cases for ${userName} (${lines.length} total)`
: `Most recent cases ${firstCaseNum}-${lastCaseNum} of ${cases.length} for ${userName}`;
: `Most recent cases ${firstCaseNum}-${lastCaseNum} of ${casesToDisplay.length} for ${userName}`;

const embed = {
author: {
Expand Down
3 changes: 2 additions & 1 deletion backend/src/plugins/Utility/commands/HelpCmd.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { LoadedGuildPlugin, PluginCommandDefinition } from "knub";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { env } from "../../../env.js";
import { createChunkedMessage } from "../../../utils.js";
import { utilityCmd } from "../types.js";

Expand Down Expand Up @@ -62,7 +63,7 @@ export const HelpCmd = utilityCmd({
let snippet = `**${prefix}${trigger}**`;
if (description) snippet += `\n${description}`;
if (usage) snippet += `\nBasic usage: \`${usage}\``;
snippet += `\n<https://zeppelin.gg/docs/plugins/${plugin.blueprint.name}/usage#command-${commandSlug}>`;
snippet += `\n<${env.DASHBOARD_URL}/docs/plugins/${plugin.blueprint.name}/usage#command-${commandSlug}>`;

return snippet;
});
Expand Down
88 changes: 50 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1f943f2

Please sign in to comment.