Observer templates

This commit is contained in:
Erik 2020-04-17 23:18:52 +03:00
parent 5658c11cc3
commit 3289923571
9 changed files with 276 additions and 3 deletions

View File

@ -1,5 +1,4 @@
const { Observer } = require('../../../interfaces/');
const Collection = require('../../../../util/Collection.js');
class ActivityTracker extends Observer {
@ -7,12 +6,12 @@ class ActivityTracker extends Observer {
super(client, {
name: 'activityTracker',
priority: 3,
priority: 4,
guarded: true
});
this.client = client;
this.cache = new Collection();
this.cache = { };
this.hooks = [
['message', this.onMessage.bind(this)],

View File

@ -0,0 +1,29 @@
const { Observer } = require('../../../interfaces/');
class Automute extends Observer {
constructor(client) {
super(client, {
name: 'automute',
priority: 1,
guarded: true
});
this.client = client;
this.hooks = [
['guildMemberAdd', this.onJoin.bind(this)]
];
}
async onJoin(member) {
}
}
module.exports = Automute;

View File

@ -0,0 +1,29 @@
const { Observer } = require('../../../interfaces/');
class Autorole extends Observer {
constructor(client) {
super(client, {
name: 'autorole',
priority: 3,
guarded: true
});
this.client = client;
this.hooks = [
['guildMemberAdd', this.onJoin.bind(this)]
];
}
async onJoin(member) {
}
}
module.exports = Autorole;

View File

@ -0,0 +1,36 @@
const { Observer } = require('../../../interfaces/');
class BanLogger extends Observer {
constructor(client) {
super(client, {
name: 'autorole',
priority: 3,
guarded: true
});
this.client = client;
this.hooks = [
['guildBanAdd', this.onBan.bind(this)],
['guildBanRemove', this.onUnban.bind(this)]
];
}
async onBan(guild, member) {
}
async onUnban(guild, member) {
}
}
module.exports = BanLogger;

View File

@ -0,0 +1,36 @@
const { Observer } = require('../../../interfaces/');
class Invitefilter extends Observer {
constructor(client) {
super(client, {
name: 'invitefilter',
priority: 1,
guarded: true
});
this.client = client;
this.hooks = [
['messageUpdate', this.onEdit.bind(this)],
['message', this.onMessage.bind(this)]
];
}
async onEdit(oldMsg, newMsg) {
}
async onMessage(message) {
}
}
module.exports = Invitefilter;

View File

@ -0,0 +1,36 @@
const { Observer } = require('../../../interfaces/');
class Linkfilter extends Observer {
constructor(client) {
super(client, {
name: 'linkfilter',
priority: 1,
guarded: true
});
this.client = client;
this.hooks = [
['messageUpdate', this.onEdit.bind(this)],
['message', this.onMessage.bind(this)]
];
}
async onEdit(oldMsg, newMsg) {
}
async onMessage(message) {
}
}
module.exports = Linkfilter;

View File

@ -0,0 +1,36 @@
const { Observer } = require('../../../interfaces/');
class MemberLogger extends Observer {
constructor(client) {
super(client, {
name: 'memberLogger',
priority: 3,
guarded: true
});
this.client = client;
this.hooks = [
['guildMemberAdd', this.onJoin.bind(this)],
['guildMemberRemove', this.onLeave.bind(this)]
];
}
async onJoin(member) {
}
async onLeave(member) {
}
}
module.exports = MemberLogger;

View File

@ -0,0 +1,36 @@
const { Observer } = require('../../../interfaces/');
class MemberUpdates extends Observer {
constructor(client) {
super(client, {
name: 'memberUpdates',
priority: 3,
guarded: true
});
this.client = client;
this.hooks = [
['voiceStateUpdate', this.onVoice.bind(this)],
['guildMemberUpdate', this.onMember.bind(this)]
];
}
async onVoice(oldState, newState) {
}
async onMember(oldMember, newMember) {
}
}
module.exports = MemberUpdates;

View File

@ -0,0 +1,36 @@
const { Observer } = require('../../../interfaces/');
class Wordfilter extends Observer {
constructor(client) {
super(client, {
name: 'wordfilter',
priority: 1,
guarded: true
});
this.client = client;
this.hooks = [
['messageUpdate', this.onEdit.bind(this)],
['message', this.onMessage.bind(this)]
];
}
async onEdit(oldMsg, newMsg) {
}
async onMessage(message) {
}
}
module.exports = Wordfilter;