Last active
June 24, 2024 07:08
-
-
Save dz4k/dc9ec680b1cd874ac1daac2d209ca26d to your computer and use it in GitHub Desktop.
Discord bot in _hyperscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require discord.js as Discord | |
init immediately | |
make a Discord.Client from { | |
intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES] | |
} | |
set module discord to it | |
login(process.env.TOKEN) to discord | |
end | |
on ready from discord | |
log 'LOGIN', discord.user.tag | |
end | |
on messageCreate(content, author) from discord | |
log 'MESSAGE', content | |
if content is '!ping' then | |
reply(`pong <@${author.id}>`) to event | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment