style: format code with black

Format code with black

This commit fixes the style issues introduced in 7b7f300 according to the output
from Black.

Details: None
This commit is contained in:
deepsource-autofix[bot] 2023-09-08 23:45:39 +00:00 committed by GitHub
parent 7b7f30067b
commit f516ebf519
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 29 deletions

View file

@ -33,7 +33,9 @@ class Img(commands.Cog):
elif ctx.message.embeds and ctx.message.embeds[0].image:
image_attachments = ctx.message.embeds[0].image
else:
async for message in ctx.guild.get_channel(ctx.channel.id).history(limit=10):
async for message in ctx.guild.get_channel(ctx.channel.id).history(
limit=10
):
if message.attachments:
image_attachments = message.attachments[0]
break
@ -70,8 +72,7 @@ class Img(commands.Cog):
return
elif (
image_attachments.url
and not image_attachments.url.split(".")[-1].lower()
in IMAGE_EXTENSIONS
and not image_attachments.url.split(".")[-1].lower() in IMAGE_EXTENSIONS
):
error = (
"Unsupported file type! Supported file types are:\n"
@ -80,10 +81,7 @@ class Img(commands.Cog):
await ctx.reply(embed=error_message(error))
return
if (
image_attachments.size
and image_attachments.size > 8 * 1024 * 1024
):
if image_attachments.size and image_attachments.size > 8 * 1024 * 1024:
error = (
"That image is too big! Please use an image that is less than 8MB."
)

View file

@ -8,40 +8,42 @@ from discord.gateway import _log
async def mobile_status(self):
payload = {
'op': self.IDENTIFY,
'd': {
'token': self.token,
'properties': {
'$os': sys.platform,
'$browser': 'Discord Android',
'$device': 'Discord Android',
'$referrer': '',
'$referring_domain': ''
"op": self.IDENTIFY,
"d": {
"token": self.token,
"properties": {
"$os": sys.platform,
"$browser": "Discord Android",
"$device": "Discord Android",
"$referrer": "",
"$referring_domain": "",
},
'compress': True,
'large_threshold': 250,
'v': 3
}
"compress": True,
"large_threshold": 250,
"v": 3,
},
}
if self.shard_id is not None and self.shard_count is not None:
payload['d']['shard'] = [self.shard_id, self.shard_count]
payload["d"]["shard"] = [self.shard_id, self.shard_count]
state = self._connection
if state._activity is not None or state._status is not None:
payload['d']['presence'] = {
'status': state._status,
'game': state._activity,
'since': 0,
'afk': False
payload["d"]["presence"] = {
"status": state._status,
"game": state._activity,
"since": 0,
"afk": False,
}
if state._intents is not None:
payload['d']['intents'] = state._intents.value
payload["d"]["intents"] = state._intents.value
await self.call_hooks('before_identify', self.shard_id, initial=self._initial_identify)
await self.call_hooks(
"before_identify", self.shard_id, initial=self._initial_identify
)
await self.send_as_json(payload)
_log.info('Shard ID %s has sent the IDENTIFY payload.', self.shard_id)
_log.info("Shard ID %s has sent the IDENTIFY payload.", self.shard_id)
def error_message(error: str) -> discord.Embed: