stop sending messages to inaccessible channels

This commit is contained in:
ouwou
2022-05-08 00:27:48 -04:00
parent f6fdfeb95f
commit 3b5f4ded31

View File

@@ -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