mirror of
https://github.com/myned/modufur.git
synced 2024-12-25 06:37:29 +00:00
Removed branch identifier for UA header
This commit is contained in:
parent
3b4d5257fe
commit
c288adcfe6
1 changed files with 9 additions and 9 deletions
|
@ -77,6 +77,15 @@ session = aiohttp.ClientSession()
|
|||
last_commands = {}
|
||||
|
||||
|
||||
async def fetch(url, *, params={}, json=False, response=False):
|
||||
async with session.get(url, params=params, headers={'User-Agent': 'Myned/Modumind'}) as r:
|
||||
if response:
|
||||
return r
|
||||
elif json:
|
||||
return await r.json()
|
||||
return await r.read()
|
||||
|
||||
|
||||
# async def clear(obj, interval=10 * 60, replace=None):
|
||||
# if replace is None:
|
||||
# if type(obj) is list:
|
||||
|
@ -108,15 +117,6 @@ def close(loop):
|
|||
print('Finished cancelling tasks.')
|
||||
|
||||
|
||||
async def fetch(url, *, params={}, json=False, response=False):
|
||||
async with session.get(url, params=params, headers={'User-Agent': 'Myned/Modumind/dev'}) as r:
|
||||
if response:
|
||||
return r
|
||||
elif json:
|
||||
return await r.json()
|
||||
return await r.read()
|
||||
|
||||
|
||||
def generate_embed(ctx, *, title=d.Embed.Empty, type='rich', description=d.Embed.Empty, url=d.Embed.Empty, timestamp=d.Embed.Empty, colour=color, footer={}, image=d.Embed.Empty, thumbnail=d.Embed.Empty, author={}, fields=[]):
|
||||
embed = d.Embed(title=title, type=type, description=description, url=url, timestamp=timestamp, colour=colour if isinstance(ctx.channel, d.TextChannel) else color)
|
||||
|
||||
|
|
Loading…
Reference in a new issue