def _font(self, url: str=None):
"""Allows you to set the font that the fortune cookies are shown in.
Only accepts ttf."""
option = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0)'
' Gecko/20100101 Firefox/40.1'}
if url is None :
url = "https://cdn.discordapp.com/attachments/218222973557932032/240223136447070208/FortuneCookieNF.ttf"
if os.is_file("data/horoscope/FortuneCookieNF.ttf"):
return
else:
async with aiohttp.request("GET", url, headers=option) as resp:
test = await resp.read()
with open("data/horoscope/FortuneCookieNF.ttf", "wb") as f:
f.write(test)
elif not url.endswith("ttf"):
await self.bot.say("This is not a .ttf font, please use a .ttf font. Thanks")
return
await self.bot.say("Font has been saved")
评论列表
文章目录