Merge pull request #2 from Kanium/feature/explicitGuildID

implmented a guild dm restriction using guildID
This commit is contained in:
Hattenburg 2020-04-10 13:47:46 +02:00 committed by GitHub
commit 496ac4e599
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,9 @@ from redbot.core.utils.chat_formatting import box, humanize_list, pagify
url = 'https://raw.githubusercontent.com/Kanium/KaniumCogs/master/welcomeCog/data/embedded_message.json'
allowed_guilds = {274657393936302080, 693796372092289024}
async def fetchMessage():
async def fetch():
async with aiohttp.ClientSession() as session:
@ -43,6 +46,8 @@ class WelcomeCog(commands.Cog):
@commands.Cog.listener()
async def on_member_join(self, member: discord.Member):
try:
if member.guild.id not in allowed_guilds:
return
if self.message == '':
self.message = await fetchMessage()
message = formatMessage(self.message)