_FakeSlashMessage is missing the `clean_content' attribute #83

Closed
opened 2021-10-02 16:34:52 +00:00 by Soheab · 0 comments
Soheab commented 2021-10-02 16:34:52 +00:00 (Migrated from github.com)

Summary

Accessing the clean_content attribute from _FakeSlashMessage results in an error.

Reproduction Steps

run the application command below.

Minimal Reproducible Code

from discord.ext import commands


bot = commands.Bot(...)


@bot.command(slash_command = True)
async def repeat_my_message(ctx):
    await ctx.send(f"sure thing {ctx.author.name}!\n{ctx.message.clean_content}")

Expected Results

It sending the cleaned content.

Actual Results

Raised a python AttributeError: AttributeError: '_FakeSlashMessage' object has no attribute 'clean_content'

Intents

discord.Indendts(mesages = True) # hehe

System Information

  • Python v3.9.6-final
  • discord.py v2.0.0-alpha
    • discord.py pkg_resources: v2.0.0a3642+g3260ec66
  • aiohttp v3.7.4.post0
  • system info: Windows 10 10.0.22000 (win11)

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

Gnome = ❤️

### Summary Accessing the clean_content attribute from _FakeSlashMessage results in an error. ### Reproduction Steps run the application command below. ### Minimal Reproducible Code ```python from discord.ext import commands bot = commands.Bot(...) @bot.command(slash_command = True) async def repeat_my_message(ctx): await ctx.send(f"sure thing {ctx.author.name}!\n{ctx.message.clean_content}") ``` ### Expected Results It sending the cleaned content. ### Actual Results Raised a python `AttributeError`: `AttributeError: '_FakeSlashMessage' object has no attribute 'clean_content'` ### Intents discord.Indendts(mesages = True) # hehe ### System Information - Python v3.9.6-final - discord.py v2.0.0-alpha - discord.py pkg_resources: v2.0.0a3642+g3260ec66 - aiohttp v3.7.4.post0 - system info: Windows 10 10.0.22000 (win11) ### Checklist - [X] I have searched the open issues for duplicates. - [X] I have shown the entire traceback, if possible. - [X] I have removed my token from display, if visible. ### Additional Context Gnome = ❤️
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: matthew/enhanced-discord.py#83
No description provided.