Back to APIs list

Discord API examples & templates

Use these vals as a playground to view and fork Discord API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
gigmx avatar
gigmx
zyloxAIChatApp
HTTP
@jsxImportSource https://esm.sh/react@18.2.0
0
trob avatar
trob
multiUserChatwithLLM
HTTP
@jsxImportSource https://esm.sh/react
0
dctalbot avatar
dctalbot
pirateTalk
HTTP
A Slack bot which rephrases messages in a channel in the voice of a Pirate. Originally built for National Talk Like a Pirate Day, September 19, 2024. https://dctalbot.nyc/blog/pirate-talk/
0
sjmre avatar
sjmre
telegramSendMessage
Script
Forked from vtdocs/telegramSendMessage
0
ryoid avatar
ryoid
chat
Script
An interactive, runnable TypeScript val by ryoid
0
narthur avatar
narthur
telegramBot
Script
An interactive, runnable TypeScript val by narthur
0
odicho avatar
odicho
chatbot
HTTP
Forked from dglazkov/chatbot
0
kauri avatar
kauri
ddg_chat
HTTP
Simple AI chat app with markdown reneder utilizing DuckDuckGo Chat API
0
roysarajit143 avatar
roysarajit143
ALPHANUMERIC_TEXT_TOO_LONG
HTTP
@jsxImportSource https://esm.sh/react@18.2.0
0
lazyplatypus avatar
lazyplatypus
chatWithCerebras
HTTP
Forked from stevekrouse/chatWithCerebras
0
darrinm avatar
darrinm
chat
Script
Forked from nimalu/chat
0
karkowg avatar
karkowg
isAaronAtTheBadPlaceYet
Cron
Is Aaron Francis at the bad place yet? Periodically check if Aaron Francis has created his account on bsky!
0
singpolyma avatar
singpolyma
sendxmpplib
Script
Simple helper for sending a message over XMPP. For an API that doesn't require your own bot setup see https://www.val.town/v/singpolyma/sendxmpp import sendxmpp from "https://esm.town/v/singpolyma/sendxmpplib"; await sendxmpp("someone@example.com", "Hello!"); Also supports optional keepalive to send multiple messages with one connection: import sendxmpp from "https://esm.town/v/singpolyma/sendxmpplib"; await sendxmpp("someone@example.com", "1", true); await sendxmpp("someone@example.com", "2", true); await sendxmpp("someone@example.com", "3); Or even manual disconnect: import sendxmpp from "https://esm.town/v/singpolyma/sendxmpplib"; await sendxmpp("someone@example.com", "1", true); await sendxmpp("someone@example.com", "2", true); const stop = sendxmpp("someone@example.com", "3", true); stop(); Environment variables needed for your bot: XMPP_URI=wss://example.com XMPP_DOMAIN=example.com XMPP_USERNAME=bot XMPP_PASSWORD=password Only websockets or direct tls (xmpps://) connections are supported until https://github.com/denoland/deno/issues/26685 is fixed
0
nlnhsr avatar
nlnhsr
chatbot
HTTP
Forked from odicho/chatbot
0
artalar avatar
artalar
jentlemans_bot
HTTP
Forked from maxm/telegramWebhookExample
0
begoon avatar
begoon
telegrambot
HTTP
This val is a demo skeleton of a telegram chat bot. It requires the BOT_TOKEN environment varialbe, which the telegram bot token. Another required variable is ME. The variable is an HTTP header to call a few extra endpoints (see the code). One of those endpoints is /webhook/set , which installs the webhook to activate the bot. The code is mostly educational. The bot echos back incoming messages. There is one command, /ai , which sends the incoming messages to Open AI and forwards the reply back to the chat.
1