Discord.py: Cant get Client.say Command

Created on 17 May 2019  路  11Comments  路  Source: Rapptz/discord.py

import discord
from discord.ext.commands import Bot
import asyncio, json, requests
from bs4 import BeautifulSoup
import os, time, re, subprocess
with open('config.json') as (f):
data = json.load(f)
TOKEN = data['token']
BOT_PREFIX = data['prefix']
client = Bot(command_prefix= BOT_PREFIX)

tried with client.send_message and client.say

Nothing of them work, Errors:

discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Bot' object has no attribute 'send_message'

`AttributeError: 'Bot' object has no attribute 'send_message'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\Nick\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 859, in invoke
await ctx.command.invoke(ctx)
File "C:\Users\Nick\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 725, in invoke
await injected(ctx.args, *ctx.kwargs)
File "C:\Users\Nick\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 88, in wrapped
raise CommandInvokeError(exc) from exc`

All 11 comments

You seem to be using old code. The 0.16.12 version of the library is unsupported. If you need help migrating, visit the migration guide: https://discordpy.readthedocs.io/en/latest/migrating.html

If you need more help consider joining the official Discord server.

wut the new libary is shit tf i will downgrade discord libary xd

Because outdated code doesn鈥檛 work does not mean that the new version is bad

idk how to upgrade so yea

pip install -U discord.py will upgrade discord.py to the most recent version.

If you're unsure about how to update your code, have a look at the migration guide from the docs please.

pip install -U discord.py will upgrade discord.py to the most recent version.

If you're unsure about how to update your code, have a look at the migration guide from the docs please.

I did tried but it dint worked.
i have latest installed

await client.say(arg2 + ' has been successfully invited to a ')

That code is not correct, please read my reply again. There is a guide linked on how to migrate to the new version, use it, do not just ignore it.

Read the above replies however for further help with code related issues please refer to the discord.py server

That code is not correct, please read my reply again. There is a guide linked on how to migrate to the new version, use it, do not just ignore it.

i did idk how...

I Dint worked on this code 1 year ago....

I will close in 5 minutes bc its boring

@MinerChAI This was already linked twice, and pointed back to once already, useless replies like this are not conducive in bringing this issue to a resolved status.

@xKeksbyte As was said multiple times, if you want further help with this join the support server. The answer has already been given, you are using old code and an old version of the library. If you are unsure how to move forward based on the guide we have given, join the support server.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

j0hnmeow picture j0hnmeow  路  3Comments

reuscam picture reuscam  路  3Comments

jzburda picture jzburda  路  3Comments

synbitz picture synbitz  路  3Comments

Rimmy50 picture Rimmy50  路  3Comments