Update welcome.py
This commit is contained in:
parent
f1c9a78345
commit
dd9b7bc7cd
@ -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 with aiohttp.ClientSession() as session:
|
async def fetch():
|
||||||
async with session.get(url) as response:
|
async with aiohttp.ClientSession() as session:
|
||||||
html = await response.text()
|
async with session.get(url) as response:
|
||||||
x = json.loads(str(html))
|
html = await response.text()
|
||||||
return x
|
x = json.loads(str(html))
|
||||||
|
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')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user