Skip to content

Commit 5d31190

Browse files
committed
pasta tweaks
1 parent 2fdb12f commit 5d31190

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

database/pasta.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ async function savePasta(commandName, pastaName, content) {
4242
if (!content.length) throw new Error('string cannot be length zero');
4343
if (content.length > 1048576) throw new Error('paste size limit is 1MB');
4444
await fs.writeFile(filename, content, 'utf8');
45-
const url = `/${encodeURIComponent(commandName)}/${encodeURIComponent(pastaName)}`;
45+
let url = `/${encodeURIComponent(commandName)}`;
46+
if (pastaName) {
47+
url += `/${encodeURIComponent(pastaName)}`;
48+
}
4649
return {
4750
html: `/html${url}`,
4851
text: `/text${url}`,

irc/evaluate/vm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ async function createVM({ node, maxTimeout = 60000 }) {
360360
});
361361
});
362362

363-
IRC.pasta = (pasta, name = 'pasta') => {
363+
IRC.pasta = (pasta, name = '') => {
364364
const { html, text } = ref.makePasta
365365
.applySyncPromise(undefined, [pasta, name]);
366366

0 commit comments

Comments
 (0)