!notes [note name] [your notes] will create a note which can be later access using !accessnote [note name]
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
if (context.params.event.content.startsWith('!notes')) {
const name = context.params.event.content.split(' ')[1];
const value = context.params.event.content.split(' ').slice(2).join(' ');
await lib.utils.kv['@0.1.16'].set({
key: `${name}`,
value: `${value}`,
});
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `β
Successfully Created Notes!`,
});
}
if (context.params.event.content.startsWith('!accessnotes')) {
const name = context.params.event.content.split(' ')[1];
let notes = await lib.utils.kv['@0.1.16'].get({
key: `${name}`,
});
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: ``,
tts: false,
embed: {
type: 'rich',
title: `**${name}**`,
description: `${notes}`,
color: 0x00c7ff,
},
});
}