From 8afdae9b8f114c3d76e41ed212e9895db9e12007 Mon Sep 17 00:00:00 2001 From: Astoria Floyd Date: Wed, 11 Aug 2021 19:55:51 -0500 Subject: [PATCH] Prevent possible crash if no system messages channel exists. --- bot.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot.lua b/bot.lua index 1fb5810..f57e32d 100644 --- a/bot.lua +++ b/bot.lua @@ -54,7 +54,9 @@ end --When a user is banned, post a lenney. client:on('userBan', function(user, guild) - guild.systemChannel:send("A user was banned ( ͡° ͜ʖ ͡°)") + if guild.systemChannel then + guild.systemChannel:send("A user was banned ( ͡° ͜ʖ ͡°)") + end end) --Insert Token in a .lua file with simply returns it as a string.