Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions commands/article.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { createDraftArticle, setArticleForumPostUrl } = require('../services/arti
const { canEditData } = require('../utils/discordutils');

const DISCORD_MESSAGE_LINK_REGEX = /<?https?:\/\/(?:canary\.)?discord\.com\/channels\/(\d+)\/(\d+)\/(\d+)>?/gi;
const ARTICLE_HELP_RESPONSE = "The calling structure for making an article is ```!article <title>\n<content>``` where every message link will be exactly that message content, including images and most markdown formatting. All the messages, including the parent one, and their white space are respected. You're stitching them together as they literally are.\n\nOnce an article has been made it will show up in the articles forum. Reply '!delete' in the forum to remove the article from the forum and the website. To promote the article to the BTCMaxis articles list, react in the forum with a :btc: emoji";

function canUserCreateArticle(member) {
return canEditData(member);
Expand Down Expand Up @@ -206,6 +207,11 @@ async function articleCommand(message, args) {
}

const { title, bodyTemplate } = parseArticleCommandInput(message);
if (!title && !bodyTemplate) {
await message.reply(ARTICLE_HELP_RESPONSE);
return;
}

if (!title || !bodyTemplate) {
await message.reply(`Usage: \`${message.client.prefix}article <title>\` then body text with Discord message links.`);
return;
Expand Down Expand Up @@ -339,3 +345,4 @@ module.exports = {




3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ client.on('messageReactionAdd', async (reaction, user) => {
if (alreadyPublished)
return;

await message.reply("Article published and available at https://btcmaxies.com/articles.html");
await message.reply("Article published and available at https://btcmaxis.com/articles.html");
} catch (error) {
console.error('Error processing article reactions:', error);
}
Expand All @@ -540,3 +540,4 @@ client.login(TOKEN);




Loading