From 3b5f4ded3155c98e346b5b312ae943f9894fae7a Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Sun, 8 May 2022 00:27:48 -0400 Subject: stop sending messages to inaccessible channels --- src/abaddon.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/abaddon.cpp') diff --git a/src/abaddon.cpp b/src/abaddon.cpp index fe37251..6dda3f5 100644 --- a/src/abaddon.cpp +++ b/src/abaddon.cpp @@ -696,6 +696,10 @@ void Abaddon::ActionChatLoadHistory(Snowflake id) { void Abaddon::ActionChatInputSubmit(std::string msg, Snowflake channel, Snowflake referenced_message) { if (msg.substr(0, 7) == "/shrug " || msg == "/shrug") msg = msg.substr(6) + "\xC2\xAF\x5C\x5F\x28\xE3\x83\x84\x29\x5F\x2F\xC2\xAF"; // this is important + + if (!channel.IsValid()) return; + if (!m_discord.HasChannelPermission(m_discord.GetUserData().ID, channel, Permission::VIEW_CHANNEL)) return; + if (referenced_message.IsValid()) m_discord.SendChatMessage(msg, channel, referenced_message); else -- cgit v1.2.3