-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
34 lines (28 loc) · 880 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const { Plugin } = require('powercord/entities');
const { FluxDispatcher } = require('powercord/webpack');
const Settings = require('./ui/Settings.jsx');
module.exports = class AlwaysPushNotifications extends Plugin
{
startPlugin ()
{
powercord.api.settings.registerSettings(this.entityID,
{
category: this.entityID,
label: 'Always Push Notifications',
render: Settings
});
FluxDispatcher.subscribe('MESSAGE_CREATE', this.handleMessage.bind(this));
}
async handleMessage ({ message })
{
if (!this.settings.get('dm', false) && channel.isDM())
{
return null;
}
}
pluginWillUnload ()
{
powercord.api.settings.unregisterSettings(this.entityID);
FluxDispatcher.unsubscribe('MESSAGE_CREATE', this.handleMessage);
}
};