mirror of
https://github.com/xHyroM/bun-discord-bot.git
synced 2024-12-22 12:11:06 +01:00
fix: return if remap is null
This commit is contained in:
parent
e5bcf61676
commit
dbf7fcdd87
2 changed files with 3 additions and 1 deletions
|
@ -124,6 +124,7 @@ async function handleBunReportLink(message: Message): Promise<void> {
|
|||
if (!match?.[0]) return;
|
||||
|
||||
const data = await getBunReportDetailsInMarkdown(match[0]);
|
||||
if (!data) return;
|
||||
|
||||
// @ts-expect-error allowed_mentions
|
||||
message.reply({
|
||||
|
|
|
@ -52,8 +52,9 @@ export function sliceIfStartsWith(input: string, startsWith: string) {
|
|||
|
||||
export async function getBunReportDetailsInMarkdown(
|
||||
url: string
|
||||
): Promise<string> {
|
||||
): Promise<string | undefined> {
|
||||
const remap = await parseAndRemap(url);
|
||||
if (!remap) return;
|
||||
if (!Array.isArray(remap.features)) remap.features = []; // temporary fix
|
||||
|
||||
let content = formatMarkdown(remap, {
|
||||
|
|
Loading…
Reference in a new issue