Before we will start, please watch the tutorial or copy and paste this code as your template.


(No slash commands included)


          import discord
          from discord import Embed
          from discord.ext import commands
          from config import TOKEN

          intents = discord.Intents.all()
          intents.message_content = True
          bot = commands.Bot(command_prefix="$", intents=intents)

          @bot.event
          async def on_ready():
              print("The bot is online!!")

          @bot.command()
          async def embed(ctx):
              embed = discord.Embed(title="Embed Title", description="Embed description / Embed text")

              await ctx.reply(embed=embed)


          @bot.command()
          async def ping(ctx):
              await ctx.reply(f"Pong! : `{round(bot.latency * 1000)}ms`")

          bot.run(TOKEN)
        

This is our base code. First make a config.py file then proceed to create a variable named TOKEN

TOKEN="your bot token"

Inorder to get your own token follow these steps. Go to the Discord Developer Portal and click the bot tab. Then click Reset Token, then paste that in your token variable.


This is Part 1 of how to code your own discord bot series.