Check if we're not in a channel

This commit is contained in:
Jiiks 2018-08-14 15:43:55 +03:00
parent e49a1932f3
commit a90400c280
1 changed files with 1 additions and 0 deletions

View File

@ -151,6 +151,7 @@ export default new class E2EE extends BuiltinModule {
// TODO Received exchange should also expire if not accepted in time
async handlePublicKey(e) {
if (!DiscordApi.currentChannel) return;
if (DiscordApi.currentChannel.type !== 'DM') return;
const { id, content, author, channelId } = e.args;
if (author.id === DiscordApi.currentUser.id || channelId !== DiscordApi.currentChannel.id) return;