mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
Spelling correction of method name in Tunnel (#2496)
`Tunnel.files_from_attatch` was misspelled. Kept old name as an alias for backwards compatibility.
This commit is contained in:
@@ -132,7 +132,7 @@ class Tunnel(metaclass=TunnelMeta):
|
||||
return rets
|
||||
|
||||
@staticmethod
|
||||
async def files_from_attatch(m: discord.Message) -> List[discord.File]:
|
||||
async def files_from_attach(m: discord.Message) -> List[discord.File]:
|
||||
"""
|
||||
makes a list of file objects from a message
|
||||
returns an empty list if none, or if the sum of file sizes
|
||||
@@ -158,6 +158,9 @@ class Tunnel(metaclass=TunnelMeta):
|
||||
files.append(discord.File(_fp, filename=a.filename))
|
||||
return files
|
||||
|
||||
# Backwards-compatible typo fix (GH-2496)
|
||||
files_from_attatch = files_from_attach
|
||||
|
||||
async def communicate(
|
||||
self, *, message: discord.Message, topic: str = None, skip_message_content: bool = False
|
||||
):
|
||||
@@ -201,10 +204,10 @@ class Tunnel(metaclass=TunnelMeta):
|
||||
content = topic
|
||||
|
||||
if message.attachments:
|
||||
attach = await self.files_from_attatch(message)
|
||||
attach = await self.files_from_attach(message)
|
||||
if not attach:
|
||||
await message.channel.send(
|
||||
"Could not forward attatchments. "
|
||||
"Could not forward attachments. "
|
||||
"Total size of attachments in a single "
|
||||
"message must be less than 8MB."
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user