mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
ESLint stuff...
This commit is contained in:
@@ -1,38 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
const Action = require('./Action');
|
||||
const Constants = require('../../util/Constants');
|
||||
const Role = require('../../structures/Role');
|
||||
|
||||
class GuildRoleCreate extends Action {
|
||||
|
||||
constructor(client) {
|
||||
super(client);
|
||||
}
|
||||
handle(data) {
|
||||
const client = this.client;
|
||||
const guild = client.store.get('guilds', data.guild_id);
|
||||
|
||||
handle(data) {
|
||||
if (guild) {
|
||||
const already = guild.store.get('roles', data.role.id);
|
||||
const role = new Role(guild, data.role);
|
||||
guild.store.add('roles', role);
|
||||
|
||||
let client = this.client;
|
||||
let guild = client.store.get('guilds', data.guild_id);
|
||||
if (!already) {
|
||||
client.emit(Constants.Events.GUILD_ROLE_CREATE, guild, role);
|
||||
}
|
||||
|
||||
if (guild) {
|
||||
let already = guild.store.get('roles', data.role.id);
|
||||
let role = new Role(guild, data.role);
|
||||
guild.store.add('roles', role);
|
||||
return {
|
||||
role,
|
||||
};
|
||||
}
|
||||
|
||||
if (!already) {
|
||||
client.emit(Constants.Events.GUILD_ROLE_CREATE, guild, role);
|
||||
}
|
||||
|
||||
return {
|
||||
role,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
role: null,
|
||||
};
|
||||
}
|
||||
};
|
||||
return {
|
||||
role: null,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = GuildRoleCreate;
|
||||
|
||||
Reference in New Issue
Block a user