mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 22:21:51 +00:00
30 lines
633 B
TypeScript
30 lines
633 B
TypeScript
![]() |
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) {
|
||
|
const roles = (msg.channel as TextChannel).guild.roles.map(
|
||
|
role => `${role.name} ${role.id}`
|
||
|
);
|
||
|
msg.channel.createMessage("```" + roles.join("\n") + "```");
|
||
|
}
|
||
|
}
|