Replies: 2 comments 3 replies
-
Havet the answer. |
Beta Was this translation helpful? Give feedback.
-
The issue is with: if message.content == ('b.avatar'): That means, if there is something after For example, your entire avatar command could be rewritten to: (this is not the full code, just the avatar command) @client.command()
async def avatar(ctx, member: discord.Member = None):
if not member:
return await ctx.send("You have to mention someone.")
await ctx.send(f"Here: {member.avatar_url}") Also, I see you have |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey Guys!
I don't know why, but a part of my code stoped working. Yesterday it worked all fine but today it doesn't work anymore. I wan't the bot to do: Every time, a user sends "b.avatar @user" the bot respondes with the avatar of the mentioned user.
code:
import discord, sys, os, time, json, requests
client = discord.Client()
admin = (604793540395925536)
@client.event
async def on_ready():
print('Logged in as {0.user}'.format(client))
await client.change_presence(activity=discord.Activity(type=discord.ActivityType.listening, name="Function Testscript / *******."))
@client.event
async def on_message(message):
if message.author == client.user:
return
client.run('my_token')
again it just stoped working and there is no error.
Beta Was this translation helpful? Give feedback.
All reactions