


It could be done by running the given code. We need to give the file name to it and the file should be in the same directory where our code is. The image could be sent through the bot in the form of a file. When you type “hi” in the channel, the bot will respond with the “Hello!” message. Print('We have logged in as def on_message(message):Īfter running the code, the bot that we had built will come online to respond to our messages. import discordĬlient = discord.Client(command_prefix='!', def on_ready(): Step 7: Get the text response from the bot. After that select the server to which you want to add your bot, allow permission to the bot and add the bot to your server. Now scroll down and in the bot permission select the following permission. Step 5: If your bot is not verified, you can toggle those intents below to access them. Step 4: After the bot is added to your channel copy the bot token. You will have to confirm by clicking “Yes, do it!”. Step 3: Go to the “Bot” tab and then click “Add Bot”. Give the name to your bot and then click on create. Step 2: Now go to the discord development website. Step 1: Create an account on discord by visiting the website, and also create a server and a channel. Here we learn how we can get the following responses from the bot: How we can send text, image, video, audio, files through the bot, and further when we send any file to the channel how we can get it at the server-side in our computer. In this tutorial, we will learn to create a Discord bot and add it to our channel. Discord is a group-chat platform similar to Skype, TeamSpeak, or Slack that allows users to communicate simple text messages as well as rich messaging.
