Fixed ~dm command by making sure the bot doesn't reply to itself

pull/2/head
sgoudham 4 years ago
parent cd4a366b85
commit b86ef8ac9b

@ -245,9 +245,11 @@ async def marry(ctx, member: discord.Member):
await ctx.send("Awww they waited too long (✖╭╮✖)")
"""# Allows the bot to echo the dm's that it receives
# Allows the bot to echo the dm's that it receives
@client.event
async def on_message(message):
if message.author == client.user:
return
# Checking if the message is not sent in server
if message.guild is None:
# Checking if the owner is sending the message
@ -260,7 +262,7 @@ async def on_message(message):
channel = client.get_channel(721449922838134876)
await channel.send(message.content)
await client.process_commands(message)"""
await client.process_commands(message)
# Bot Event for handling all errors within discord.commands

@ -176,17 +176,15 @@ class Fun(commands.Cog):
# Send out one of the responses stored in the array
await ctx.send(f"{ctx.author.mention} {random.choice(responses)}")
"""
# ~dm only allows me to dm anyone through the bot
@commands.command()
@commands.is_owner()
async def dm(self, ctx, member: discord.Member, *, text):
# Send the message typed the mentioned user
await member.send(text)
# Send the message typed the mentioned user
await member.send(text)
# Delete the message sent instantly
await ctx.message.delete()
"""
# Delete the message sent instantly
await ctx.message.delete()
# ~remindme command to allow the bot to dm you to remind you of something
@commands.command(aliases=["remindme", "rm"])

Loading…
Cancel
Save