mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
[lint] Remove unnecessary lambdas
Lambdas of the form `lambda x: func(x)` are redundant.
This commit is contained in:
parent
119c5a0618
commit
3679819c53
@ -110,7 +110,7 @@ class GroupCall:
|
|||||||
lookup = {u.id: u for u in self.call.channel.recipients}
|
lookup = {u.id: u for u in self.call.channel.recipients}
|
||||||
me = self.call.channel.me
|
me = self.call.channel.me
|
||||||
lookup[me.id] = me
|
lookup[me.id] = me
|
||||||
self.ringing = list(filter(None, map(lambda i: lookup.get(i), kwargs.get('ringing', []))))
|
self.ringing = list(filter(None, map(lookup.get, kwargs.get('ringing', []))))
|
||||||
|
|
||||||
def _update_voice_state(self, data):
|
def _update_voice_state(self, data):
|
||||||
user_id = int(data['user_id'])
|
user_id = int(data['user_id'])
|
||||||
|
@ -137,7 +137,7 @@ async def _default_help_command(ctx, *commands : str):
|
|||||||
pages = await bot.formatter.format_help_for(ctx, command)
|
pages = await bot.formatter.format_help_for(ctx, command)
|
||||||
|
|
||||||
if bot.pm_help is None:
|
if bot.pm_help is None:
|
||||||
characters = sum(map(lambda l: len(l), pages))
|
characters = sum(map(len, pages))
|
||||||
# modify destination based on length of pages.
|
# modify destination based on length of pages.
|
||||||
if characters > 1000:
|
if characters > 1000:
|
||||||
destination = ctx.message.author
|
destination = ctx.message.author
|
||||||
|
@ -366,7 +366,7 @@ class Message:
|
|||||||
def channel_mentions(self):
|
def channel_mentions(self):
|
||||||
if self.guild is None:
|
if self.guild is None:
|
||||||
return []
|
return []
|
||||||
it = filter(None, map(lambda m: self.guild.get_channel(m), self.raw_channel_mentions))
|
it = filter(None, map(self.guild.get_channel, self.raw_channel_mentions))
|
||||||
return utils._unique(it)
|
return utils._unique(it)
|
||||||
|
|
||||||
@utils.cached_slot_property('_cs_clean_content')
|
@utils.cached_slot_property('_cs_clean_content')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user