Add event structs
This commit is contained in:
parent
13e9c53520
commit
1bded3121e
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* BetterDiscord Base Event Struct
|
||||
* Copyright (c) 2015-present Jiiks/JsSucks - https://github.com/Jiiks / https://github.com/JsSucks
|
||||
* All rights reserved.
|
||||
* https://betterdiscord.net
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
export default class Event {
|
||||
|
||||
constructor(args) {
|
||||
this.args = args;
|
||||
|
||||
this.__eventInfo = {
|
||||
args: arguments,
|
||||
type: this.__eventType
|
||||
};
|
||||
}
|
||||
|
||||
get event() {
|
||||
return this.__eventInfo;
|
||||
}
|
||||
|
||||
get __eventType() { return null; }
|
||||
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export { default as SettingUpdatedEvent } from './settingupdated';
|
|
@ -0,0 +1,39 @@
|
|||
/**
|
||||
* BetterDiscord Setting Updated Event Struct
|
||||
* Copyright (c) 2015-present Jiiks/JsSucks - https://github.com/Jiiks / https://github.com/JsSucks
|
||||
* All rights reserved.
|
||||
* https://betterdiscord.net
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import Event from './event';
|
||||
|
||||
export default class SettingUpdatedEvent extends Event {
|
||||
|
||||
get set() {
|
||||
return this.args.set_id;
|
||||
}
|
||||
|
||||
get category() {
|
||||
return this.args.category_id;
|
||||
}
|
||||
|
||||
get setting() {
|
||||
return this.args.setting_id;
|
||||
}
|
||||
|
||||
get value() {
|
||||
return this.args.value;
|
||||
}
|
||||
|
||||
get old_value() {
|
||||
return this.args.old_value;
|
||||
}
|
||||
|
||||
get __eventType() {
|
||||
return 'setting-updated';
|
||||
}
|
||||
|
||||
}
|
|
@ -1 +1,2 @@
|
|||
export * from './error';
|
||||
export * from './events/index';
|
||||
|
|
Loading…
Reference in New Issue