Answers for "discord bot files"

14

bot discord python

import discord
from discord.ext import commands

bot = commands.Bot(command_prefix="!", description="The description")

@bot.event
async def  on_ready():
    print("Ready !")

@bot.command()
async def ping(ctx):
    await ctx.send('**pong**')

bot.run("enter the token here between the quotes")
Posted by: Guest on January-02-2021
1

Bots latency discord js

var yourping = new Date().getTime() - message.createdTimestamp
var botping = Math.round(bot.ws.ping)

message.channel.send(`Your ping: ${yourping} nBots ping: ${botping}`)
Posted by: Guest on June-21-2020

Python Answers by Framework

Browse Popular Code Answers by Language