mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-14 21:31:50 +00:00
Fix userid/channelid argument types; rename userid/userID to userId for consistency; misc code style fix
This commit is contained in:
parent
afd677b270
commit
8d8343543d
6 changed files with 17 additions and 17 deletions
|
@ -49,7 +49,7 @@ export class AutoReactionsPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
this.savedMessages.events.off("create", this.onMessageCreateFn);
|
||||
}
|
||||
|
||||
@d.command("auto_reactions", "<channelId:channelid> <reactions...>")
|
||||
@d.command("auto_reactions", "<channelId:channelId> <reactions...>")
|
||||
@d.permission("can_manage")
|
||||
async setAutoReactionsCmd(msg: Message, args: { channelId: string; reactions: string[] }) {
|
||||
const finalReactions = [];
|
||||
|
@ -83,7 +83,7 @@ export class AutoReactionsPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
msg.channel.createMessage(successMessage(`Auto-reactions set for <#${args.channelId}>`));
|
||||
}
|
||||
|
||||
@d.command("auto_reactions disable", "<channelId:channelid>")
|
||||
@d.command("auto_reactions disable", "<channelId:channelId>")
|
||||
@d.permission("can_manage")
|
||||
async disableAutoReactionsCmd(msg: Message, args: { channelId: string }) {
|
||||
const autoReaction = await this.autoReactions.getForChannel(args.channelId);
|
||||
|
|
|
@ -52,7 +52,7 @@ export class LocatePlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
|
||||
for (const alert of outdatedAlerts) {
|
||||
await this.alerts.delete(alert.id);
|
||||
await this.removeUserIDFromActiveAlerts(alert.user_id);
|
||||
await this.removeUserIdFromActiveAlerts(alert.user_id);
|
||||
}
|
||||
|
||||
this.outdatedAlertsTimeout = setTimeout(() => this.outdatedAlertsLoop(), ALERT_LOOP_TIME);
|
||||
|
@ -137,7 +137,7 @@ export class LocatePlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
async userJoinedVC(member: Member, channel: Channel) {
|
||||
if (this.usersWithAlerts.includes(member.id)) {
|
||||
this.sendAlerts(member.id);
|
||||
await this.removeUserIDFromActiveAlerts(member.id);
|
||||
await this.removeUserIdFromActiveAlerts(member.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ export class LocatePlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
async userSwitchedVC(member: Member, newChannel: Channel, oldChannel: Channel) {
|
||||
if (this.usersWithAlerts.includes(member.id)) {
|
||||
this.sendAlerts(member.id);
|
||||
await this.removeUserIDFromActiveAlerts(member.id);
|
||||
await this.removeUserIdFromActiveAlerts(member.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,9 +157,9 @@ export class LocatePlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
});
|
||||
}
|
||||
|
||||
async sendAlerts(userid: string) {
|
||||
const triggeredAlerts = await this.alerts.getAlertsByUserId(userid);
|
||||
const member = await resolveMember(this.bot, this.guild, userid);
|
||||
async sendAlerts(userId: string) {
|
||||
const triggeredAlerts = await this.alerts.getAlertsByUserId(userId);
|
||||
const member = await resolveMember(this.bot, this.guild, userId);
|
||||
|
||||
triggeredAlerts.forEach(alert => {
|
||||
const prepend = `<@!${alert.requestor_id}>, an alert requested by you has triggered!\nReminder: \`${
|
||||
|
@ -170,8 +170,8 @@ export class LocatePlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
});
|
||||
}
|
||||
|
||||
async removeUserIDFromActiveAlerts(userid: string) {
|
||||
const index = this.usersWithAlerts.indexOf(userid);
|
||||
async removeUserIdFromActiveAlerts(userId: string) {
|
||||
const index = this.usersWithAlerts.indexOf(userId);
|
||||
if (index > -1) {
|
||||
this.usersWithAlerts.splice(index, 1);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ export class NameHistoryPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
this.usernameHistory = new UsernameHistory();
|
||||
}
|
||||
|
||||
@d.command("names", "<userId:userid>")
|
||||
@d.command("names", "<userId:userId>")
|
||||
@d.permission("can_view")
|
||||
async namesCmd(msg: Message, args: { userId: string }) {
|
||||
const nicknames = await this.nicknameHistory.getByUserId(args.userId);
|
||||
|
@ -72,7 +72,7 @@ export class NameHistoryPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
@d.event("guildMemberUpdate")
|
||||
async onGuildMemberUpdate(_, member: Member) {
|
||||
const latestEntry = await this.nicknameHistory.getLastEntry(member.id);
|
||||
if (!latestEntry || latestEntry.nickname != member.nick) {
|
||||
if (!latestEntry || latestEntry.nickname !== member.nick) {
|
||||
// tslint:disable-line
|
||||
await this.nicknameHistory.addEntry(member.id, member.nick);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ export class PingableRolesPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
return this.cache.get(channelId);
|
||||
}
|
||||
|
||||
@d.command("pingable_role disable", "<channelId:channelid> <role:role>")
|
||||
@d.command("pingable_role disable", "<channelId:channelId> <role:role>")
|
||||
@d.permission("can_manage")
|
||||
async disablePingableRoleCmd(msg: Message, args: { channelId: string; role: Role }) {
|
||||
const pingableRole = await this.pingableRoles.getByChannelAndRoleId(args.channelId, args.role.id);
|
||||
|
@ -70,7 +70,7 @@ export class PingableRolesPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
);
|
||||
}
|
||||
|
||||
@d.command("pingable_role", "<channelId:channelid> <role:role>")
|
||||
@d.command("pingable_role", "<channelId:channelId> <role:role>")
|
||||
@d.permission("can_manage")
|
||||
async setPingableRoleCmd(msg: Message, args: { channelId: string; role: Role }) {
|
||||
const existingPingableRole = await this.pingableRoles.getByChannelAndRoleId(args.channelId, args.role.id);
|
||||
|
|
|
@ -177,7 +177,7 @@ export class StarboardPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
/**
|
||||
* Deletes the starboard from the specified channel. The already-posted starboard messages are retained.
|
||||
*/
|
||||
@d.command("starboard delete", "<channelId:channelid>")
|
||||
@d.command("starboard delete", "<channelId:channelId>")
|
||||
@d.permission("can_manage")
|
||||
async deleteCmd(msg: Message, args: { channelId: string }) {
|
||||
const starboard = await this.starboards.getStarboardByChannelId(args.channelId);
|
||||
|
@ -336,7 +336,7 @@ export class StarboardPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
}
|
||||
}
|
||||
|
||||
@d.command("starboard migrate_pins", "<pinChannelId:channelid> <starboardChannelId:channelid>")
|
||||
@d.command("starboard migrate_pins", "<pinChannelId:channelId> <starboardChannelId:channelId>")
|
||||
async migratePinsCmd(msg: Message, args: { pinChannelId: string; starboardChannelId }) {
|
||||
const starboard = await this.starboards.getStarboardByChannelId(args.starboardChannelId);
|
||||
if (!starboard) {
|
||||
|
|
|
@ -554,7 +554,7 @@ export class UtilityPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
}, CLEAN_COMMAND_DELETE_DELAY);
|
||||
}
|
||||
|
||||
@d.command("clean user", "<userId:userid> <count:number>")
|
||||
@d.command("clean user", "<userId:userId> <count:number>")
|
||||
@d.permission("can_clean")
|
||||
async cleanUserCmd(msg: Message, args: { userId: string; count: number }) {
|
||||
if (args.count > MAX_CLEAN_COUNT || args.count <= 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue