2018-07-01 03:35:51 +03:00
|
|
|
import { Plugin, decorators as d } from "knub";
|
|
|
|
import { Message, TextChannel } from "eris";
|
|
|
|
|
|
|
|
export class UtilityPlugin extends Plugin {
|
|
|
|
getDefaultOptions() {
|
|
|
|
return {
|
|
|
|
permissions: {
|
|
|
|
roles: false
|
|
|
|
},
|
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
level: ">=50",
|
|
|
|
permissions: {
|
|
|
|
roles: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
@d.command("roles")
|
|
|
|
@d.permission("roles")
|
|
|
|
async rolesCmd(msg: Message) {
|
2018-07-12 01:45:26 +03:00
|
|
|
const roles = (msg.channel as TextChannel).guild.roles.map(role => `${role.name} ${role.id}`);
|
2018-07-01 03:35:51 +03:00
|
|
|
msg.channel.createMessage("```" + roles.join("\n") + "```");
|
|
|
|
}
|
|
|
|
}
|