dglazkov
discordBot
Script
A simple Discord Bot scaffolding, a slight rev on the one in the valtown guide . The discordBot function takes in an object where each key is a Discord command and the value is a function to handle the command. If the function returns a Promise , it will be handled as a deferred interaction with a followup message . Usage:
import { discordBot } from "https://esm.town/v/dglazkov/discordBot";
const echo = async (data) => {
await new Promise((r) => setTimeout(r, 5000));
return {
type: 4,
data: {
content: data.data.options[0].value,
},
};
};
export default discordBot({
ping: () => ({
type: 4,
data: {
content: `Pong! It is ${new Date()}`,
},
})
echo,
});
2
jamiedubs
nftMetadata
HTTP
use by copying web API endpoint and appending "?contractAddress=...&tokenId..." - here's an example: https://jamiedubs-nftmetadata.web.val.run/?contractAddress=0x3769c5700Da07Fe5b8eee86be97e061F961Ae340&tokenId=666 uses Alchemy for indexed NFT data, via my other jamiedubs/alchemyClient val plus it's using my personal API key. don't abuse this or I'll disable it! yeesh
1
Updated: April 3, 2024