Search code examples
pythonpython-3.xdiscorddiscord.py

How to get suggestions when writing python code (discord api)


I am making a discord bot for fun and have run into some inconvenience. For example in this function

@client.event
    async def on_message(message):

When I write message. PyCharm (does this work in other editors?) doesn't show suggestions for available methods, properties, etc. Is it possible to set this up so that for example when I type message. suggestions will come up, such as author, etc.


Solution

  • Yes, but you may need to set a type to your parameter.

    import discord
    @client.event
        async def on_message(message:Discord.message):