How can I send an embed via my Discord bot, w/python?

To get it to work I changed your send_message line to await message.channel.send(embed=embed) Here is a full example bit of code to show how it all fits: @client.event async def on_message(message): if message.content.startswith(‘!hello’): embedVar = discord.Embed(title=”Title”, description=”Desc”, color=0x00ff00) embedVar.add_field(name=”Field1″, value=”hi”, inline=False) embedVar.add_field(name=”Field2″, value=”hi2″, inline=False) await message.channel.send(embed=embedVar) I used the discord.py docs to help find this. … Read more

AttributeError: ‘Client’ object has no attribute ‘send_message’ (Discord Bot)

You are probably running the rewrite version of discord.py, since the discord.Client object does not a have a send_message method. To fix your problem you can just have it as: async def test(author, message): await message.channel.send(‘I heard you! {0.name}’.format(author)) but for what i see you doing I reccomend using the commands extension This makes creating … Read more

How can I run an async function using the schedule library?

Another option is to use apscheduler‘s AsyncIOScheduler, which works more naturally with async functions (such as send_channel). In your case, you can simply write something of the form: scheduler = AsyncIOScheduler() scheduler.add_job(send_channel, trigger=tr) scheduler.start() Where tr is a trigger object. You can use either IntervalTrigger with a 1-day interval and a start date at 21:57, … Read more

Add button components to a message (discord.py)

New Answer Discord.py 2.0 Allows for use of Buttons and Dropdowns, and has new added support for Slash Commands. A 3rd party repository is no longer necessary. However, if you don’t want to use the default one for some reason, you can checkout discord_slash. To upgrade to Discord.py 2.0: Windows: pip install -U git+https://github.com/Rapptz/discord.py MacOS … Read more