DEV Community

Cover image for Get started with discord.py

Get started with discord.py

terabyte. on March 04, 2021

Discord.py is a very powerful API. It aims to make creating Discord bots incredibly easy while still giving lots of power to the user. People have ...
Collapse
 
codeperfectplus profile image
Deepak Raj
@bot.command(name='hello', description="Greet the user!")
async def hello(ctx):
    await ctx.send(f"Hello {ctx.author.name}!") # f-string
Enter fullscreen mode Exit fullscreen mode

It's not working for me

Collapse
 
mikeywastaken profile image
terabyte.

Is there an error, or is there just nothing happening?

Collapse
 
codeperfectplus profile image
Deepak Raj

It worked latter issue was due to other asynchronous function.

Thread Thread
 
mikeywastaken profile image
terabyte.

Oh, ok! Glad it works for you then!

Collapse
 
sarmqn profile image
Sarmqn

Is there a way I can contact you personally to talk to you about a few of these things?

Collapse
 
mikeywastaken profile image
terabyte. • Edited

Sure! you can join my discord server! You can also send me a DM on here!

Collapse
 
sarmqn profile image
Sarmqn

you need to open your inbox in your settings under extensions so people can DM you on here I think.

Collapse
 
pythondev1 profile image
Kate

how do i send a message in a specific channel

Collapse
 
lorenzoblog profile image
Lorenzo • Edited

Thank for the mention. Nice first article!

Collapse
 
mikeywastaken profile image
terabyte.

Thanks! :)

Collapse
 
gnypkuba profile image
0dD3K

i want to only be able to send links to links channel, what do i do?

Collapse
 
mikeywastaken profile image
terabyte. • Edited

You could check if message.channel.id == 123456789098
(123456789098 is your channel id, of course)

If it matches, just return.

Collapse
 
mrfenek profile image
MisterFenek

Thank you so much! your module for discord.py very much helped me in bot developement