Discord is a chat app with a following of millions of users. It’s simple to use and can be accessed on any device. But what many people don’t know is that Discord can be used for far more than just chatting with friends.
Discord can be used for automation and programming. By using Discord’s built-in scripting capabilities, you can automate tasks, create bots, and even build your own mini-programs right inside Discord.
In this article, I’m going to show you how to use Discord for automation and programming. I’ll also share some tips and tricks for getting the most out of Discord’s scripting capabilities.
Discord’s Built-in Scripting Language
Discord comes with a built-in scripting language called “Discordia.” This language allows you to write programs right inside Discord. You can use Discordia to automate tasks, create bots, or even build mini-programs.
To get started with Discordia, head over to the documentation page. The documentation page contains everything you need to get started with writing Discordia scripts.
Once you’ve read through the documentation, it’s time to start writing some code. For this example, we’re going to write a simple “Hello World” script. This script will print “Hello World” into the chat every time someone says “!hello.”
// Hello World example script
on(“chat:message”, function(msg) {
if(msg.content === “!hello”) {
msg.reply(“Hello World!”);
}
}); // This line tells the script to listen for chat messages // This line checks if the message contains the text “!hello” // This line responds to the message with “Hello World!”
As you can see, the code is pretty simple. The first line tells the script to listen for chat messages. The second line checks if the message contains the text “!hello.” If it does, the third line responds to the message with “Hello World!”
on(“chat:message”, function(msg) { msg.reply(“I’m a bot!”); }); // This line tells the script to listen for chat messages // This line responds to every chat message with “I’m a bot!”