how are discord bots made code example

Example 1: how to make a discord bot

//discord.js is probably the easiest to learn. To install do this
//in command prompt (Windows, Linux) or terminal (Mac)

npm init
//and then
npm i discord.js

//after that just read the discord.js.org documentation
//and follow a couple yt guides, maybe join some servers.

Example 2: what are discord bots

import discord
from discord.ext import commands

client = commands.Bot(command_prefix = '!')

@client.event
async def on_ready():
	print('Bot is Connected!')
    
@client.command() # An example message command
async def ping(ctx):
  await ctx.send('Pong!')
  
@client.command() # An example timer
async def timer(ctx, timeSecond):
  try:
    timeSeconds = int(timeSecond)
    timer_msg = await ctx.send(f'**{timeSeconds}** seconds remaining!')
	while timeSecond != 0:
      timeSeconds -= 1
      timer_msg.edit(content=f'**{timeSeconds}** seconds remaining!')
    await ctx.send(f'{ctx.author.mention} **TIMER ENDED!!!**')
  except ValueError:
    await ctx.send('Sorry, it must be a number!')
  
client.run('TOKEN') # <--------- Your Discord bot Token Here