Update welcome.py

This commit is contained in:
Fadi AT 2020-03-30 19:50:37 +03:00
parent f1c9a78345
commit dd9b7bc7cd

View File

@ -9,11 +9,13 @@ from redbot.core.utils.chat_formatting import box, humanize_list, pagify
url = 'https://raw.githubusercontent.com/Kanium/KanuimCogs/master/welcomeCog/data/embedded_message.json' url = 'https://raw.githubusercontent.com/Kanium/KanuimCogs/master/welcomeCog/data/embedded_message.json'
async def fetchMessage(): async def fetchMessage():
async def fetch():
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
async with session.get(url) as response: async with session.get(url) as response:
html = await response.text() html = await response.text()
x = json.loads(str(html)) x = json.loads(str(html))
return x return x
return await fetch()
def formatMessage(jsonFormat): def formatMessage(jsonFormat):
try: try:
@ -41,7 +43,6 @@ class WelcomeCog(commands.Cog):
@commands.Cog.listener() @commands.Cog.listener()
async def on_member_join(self, member: discord.Member): async def on_member_join(self, member: discord.Member):
try: try:
await member.send('sending') await member.send('sending')
if self.message == '': if self.message == '':
await member.send('modifying') await member.send('modifying')