mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-08 20:28:55 -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:
parent
b4753a02de
commit
30fa9303e8
@ -165,7 +165,7 @@ class Reports(commands.Cog):
|
|||||||
if channel is None:
|
if channel is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
files: List[discord.File] = await Tunnel.files_from_attatch(msg)
|
files: List[discord.File] = await Tunnel.files_from_attach(msg)
|
||||||
|
|
||||||
ticket_number = await self.config.guild(guild).next_ticket()
|
ticket_number = await self.config.guild(guild).next_ticket()
|
||||||
await self.config.guild(guild).next_ticket.set(ticket_number + 1)
|
await self.config.guild(guild).next_ticket.set(ticket_number + 1)
|
||||||
|
|||||||
@ -132,7 +132,7 @@ class Tunnel(metaclass=TunnelMeta):
|
|||||||
return rets
|
return rets
|
||||||
|
|
||||||
@staticmethod
|
@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
|
makes a list of file objects from a message
|
||||||
returns an empty list if none, or if the sum of file sizes
|
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))
|
files.append(discord.File(_fp, filename=a.filename))
|
||||||
return files
|
return files
|
||||||
|
|
||||||
|
# Backwards-compatible typo fix (GH-2496)
|
||||||
|
files_from_attatch = files_from_attach
|
||||||
|
|
||||||
async def communicate(
|
async def communicate(
|
||||||
self, *, message: discord.Message, topic: str = None, skip_message_content: bool = False
|
self, *, message: discord.Message, topic: str = None, skip_message_content: bool = False
|
||||||
):
|
):
|
||||||
@ -201,10 +204,10 @@ class Tunnel(metaclass=TunnelMeta):
|
|||||||
content = topic
|
content = topic
|
||||||
|
|
||||||
if message.attachments:
|
if message.attachments:
|
||||||
attach = await self.files_from_attatch(message)
|
attach = await self.files_from_attach(message)
|
||||||
if not attach:
|
if not attach:
|
||||||
await message.channel.send(
|
await message.channel.send(
|
||||||
"Could not forward attatchments. "
|
"Could not forward attachments. "
|
||||||
"Total size of attachments in a single "
|
"Total size of attachments in a single "
|
||||||
"message must be less than 8MB."
|
"message must be less than 8MB."
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user