Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.77k stars 3.75k forks source link

client.send_message(message.channel, msg) issue #2071

Closed MuFFyy closed 5 years ago

MuFFyy commented 5 years ago

I had a working bot, i think i was using python 3.5, ive since wiped my computer and ive installed 3.7 and the bots not working. Example what i use to use `

import discord
client = discord.Client()

@client.event
async def on_message(message)
    if message.content.startswith('!!!invite'):
        msg = "Invite link: <https://discordapp.com/oauth2/authorize?client_id=xxxxxxxxxxxxxxxxxx&scope=bot&permissions=8>"
        await client.send_message(message.channel, msg)

im now getting "instance of client has no send_message member" error from VS Code. im not sure if different version of would cause this or is there something else going on.

Any help would be great

Vexs commented 5 years ago

The rewrite branch (1.0.x) was pushed to master and pypi a couple days ago. The async branch (0.16.x), the version you are trying to use, is no longer supported, and it is suggested that you migrate to the new lib version.

For further help specific to using this library, you should join either the official discord.py server or the Discord API server, as the README recommends.

Rapptz commented 5 years ago

The old version of discord.py (v0.16.12), which this code is using, is now unsupported. You can see how to upgrade to the newer version in the migrating guide. https://discordpy.readthedocs.io/en/latest/migrating.html

retryoos commented 5 years ago

I get an error on this code await client.send_message(message.channel, embed=embed)

error: Instance of 'Client' has no 'send_message' member @Rapptz

AXVin commented 5 years ago

@DmtKall that's right. The version of the library (v0.16.x) you are using is no longer supported. You need to upgrade/migrate to v1.x Migration Guide: https://discordpy.readthedocs.io/en/latest/migrating.html For help, Join the official discord server!