Saltar al contenido

cómo obtener el ID de cliente de un ejemplo de código de discord py de usuario

Ejemplo 1: discord py obtener usuario por id

user = bot.get_user(user_id)

Ejemplo 2: discord.py

# Discord.py is a API wrapper for python. 
Docs = "https://discordpy.readthedocs.io/en/latest/"
PyPI = "pip install -U discord.py"

# --- A simple bot ---

import discord
from discord.ext import commands 

client = commands.Bot(comand_prefix='bot prefix here') # You can choose your own prefix here

@client.event()
async def on_ready(): # When the bot starts
    print(f"Bot online and logged in as {client.user}")

# A simple command
@client.command(aliases=["ms", "aliases!"]) # You make make the command respond to other commands too
async def ping(ctx, a_variable): # a_variable is a parameter you use in the command
    await ctx.send(f"Pong! {round(client.latency * 1000)}ms. Your input was {a_variable}")

client.run('your token here') # Running the bot
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)



Utiliza Nuestro Buscador

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *