discord.py install
GREAT answers, me, a noob at python did not know that I had to run the pip install discord.py INSIDE the scripts folder eg C:/users/ben/AppData/local/programs/python/python32/scripts (I think)
discord.py install
GREAT answers, me, a noob at python did not know that I had to run the pip install discord.py INSIDE the scripts folder eg C:/users/ben/AppData/local/programs/python/python32/scripts (I think)
how to put in code to download discord py
pip install discord.py==1.3.4
discord .py
import discord client = discord.Client() @client.event async def on_ready(): print('Logged in as {0.user}'.format(client)) @client.event async def on_message(message): if message.author == client.user: return if message.content.startswith('$hello'): await message.channel.send('Hello!') client.run('your token here')
create a role with discord.py
@client.command(aliases=['make_role']) @commands.has_permissions(manage_roles=True) # Check if the user executing the command can manage roles async def create_role(ctx, *, name): guild = ctx.guild await guild.create_role(name=name) await ctx.send(f'Role `{name}` has been created')
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
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us