1
0
Fork 0
mirror of synced 2024-06-01 18:29:38 +12:00

Correct how to check settings

This commit is contained in:
phxntxm 2019-02-17 14:13:23 -06:00
parent 867fea273b
commit 2035b963eb

View file

@ -73,17 +73,17 @@ class StatsUpdate:
SELECT SELECT
COALESCE(welcome_alerts, default_alerts) AS channel, COALESCE(welcome_alerts, default_alerts) AS channel,
welcome_msg AS msg, welcome_msg AS msg,
join_role as role join_role as role,
welcome_notifications as notify
FROM FROM
guilds guilds
WHERE WHERE
welcome_notifications = True
AND
id = $1 id = $1
""" """
settings = await self.bot.db.fetchrow(query, member.guild.id) settings = await self.bot.db.fetchrow(query, member.guild.id)
if settings: if settings:
message = settings['msg'] or "Welcome to the '{server}' server {member}!" message = settings['msg'] or "Welcome to the '{server}' server {member}!"
if settings["notify"]:
try: try:
channel = member.guild.get_channel(settings['channel']) channel = member.guild.get_channel(settings['channel'])
await channel.send(message.format(server=member.guild.name, member=member.mention)) await channel.send(message.format(server=member.guild.name, member=member.mention))
@ -107,7 +107,7 @@ SELECT
FROM FROM
guilds guilds
WHERE WHERE
welcome_notifications = True goodbye_notifications = True
AND AND
id = $1 id = $1
AND AND