Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Parameters
------------
message: :class:`.Message`
The message to create context from.
cls: Optional
The optional custom class to create Context.
Returns
---------
:class:`.Context`
The context created.
"""
prefix = await self.get_prefix(message)
if not cls:
cls = Context
ctx = cls(message=message, channel=message.channel, user=message.author, prefix=prefix)
return ctx
Parameters
------------
message: :class:`.Message`
The message to create context from.
cls: Optional[Type]
The optional custom class to create Context.
Returns
---------
:class:`.Context`
The context created.
"""
prefix = await self.get_prefix(message)
if not cls:
cls = Context
ctx = cls(message=message, channel=message.channel, user=message.author, prefix=prefix)
return ctx