mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-08 11:37:20 +00:00
Merge master
This commit is contained in:
commit
1518d58e25
53 changed files with 289 additions and 320 deletions
|
@ -100,8 +100,8 @@ export const AboutCmd = utilityCmd({
|
|||
}
|
||||
|
||||
// Use the bot avatar as the embed image
|
||||
if (pluginData.client.user!.avatarURL()) {
|
||||
aboutEmbed.thumbnail = { url: pluginData.client.user!.avatarURL()! };
|
||||
if (pluginData.client.user!.displayAvatarURL()) {
|
||||
aboutEmbed.thumbnail = { url: pluginData.client.user!.displayAvatarURL()! };
|
||||
}
|
||||
|
||||
msg.channel.send({ embeds: [aboutEmbed] });
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { APIEmbed, ImageFormat } from "discord.js";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { UnknownUser, renderUserUsername } from "../../../utils";
|
||||
import { UnknownUser, renderUsername } from "../../../utils";
|
||||
import { utilityCmd } from "../types";
|
||||
|
||||
export const AvatarCmd = utilityCmd({
|
||||
|
@ -10,17 +10,17 @@ export const AvatarCmd = utilityCmd({
|
|||
permission: "can_avatar",
|
||||
|
||||
signature: {
|
||||
user: ct.resolvedUserLoose({ required: false }),
|
||||
user: ct.resolvedMember({ required: false }) || ct.resolvedUserLoose({ required: false }),
|
||||
},
|
||||
|
||||
async run({ message: msg, args, pluginData }) {
|
||||
const user = args.user || msg.author;
|
||||
const user = args.user ?? msg.member ?? msg.author;
|
||||
if (!(user instanceof UnknownUser)) {
|
||||
const embed: APIEmbed = {
|
||||
image: {
|
||||
url: user.displayAvatarURL({ extension: ImageFormat.PNG, size: 2048 }),
|
||||
},
|
||||
title: `Avatar of ${renderUserUsername(user)}:`,
|
||||
title: `Avatar of ${renderUsername(user)}:`,
|
||||
};
|
||||
msg.channel.send({ embeds: [embed] });
|
||||
} else {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { helpers } from "knub";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { renderUserUsername } from "../../../utils";
|
||||
import { renderUsername } from "../../../utils";
|
||||
import { utilityCmd } from "../types";
|
||||
|
||||
const { getMemberLevel } = helpers;
|
||||
|
@ -18,6 +18,6 @@ export const LevelCmd = utilityCmd({
|
|||
run({ message, args, pluginData }) {
|
||||
const member = args.member || message.member;
|
||||
const level = getMemberLevel(pluginData, member);
|
||||
message.channel.send(`The permission level of ${renderUserUsername(member.user)} is **${level}**`);
|
||||
message.channel.send(`The permission level of ${renderUsername(member)} is **${level}**`);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -15,7 +15,7 @@ export const searchCmdSignature = {
|
|||
export: ct.switchOption({ def: false, shortcut: "e" }),
|
||||
ids: ct.switchOption(),
|
||||
regex: ct.switchOption({ def: false, shortcut: "re" }),
|
||||
"status-search": ct.switchOption({ def: false, shortcut: "ss" }),
|
||||
// "status-search": ct.switchOption({ def: false, shortcut: "ss" }),
|
||||
};
|
||||
|
||||
export const SearchCmd = utilityCmd({
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { VoiceChannel } from "discord.js";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { renderUserUsername } from "../../../utils";
|
||||
import { renderUsername } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { utilityCmd } from "../types";
|
||||
|
||||
|
@ -43,7 +43,7 @@ export const VcdisconnectCmd = utilityCmd({
|
|||
sendSuccessMessage(
|
||||
pluginData,
|
||||
msg.channel,
|
||||
`**${renderUserUsername(args.member.user)}** disconnected from **${channel.name}**`,
|
||||
`**${renderUsername(args.member)}** disconnected from **${channel.name}**`,
|
||||
);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { ChannelType, Snowflake, VoiceChannel } from "discord.js";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { channelMentionRegex, isSnowflake, renderUserUsername, simpleClosestStringMatch } from "../../../utils";
|
||||
import { channelMentionRegex, isSnowflake, renderUsername, simpleClosestStringMatch } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { utilityCmd } from "../types";
|
||||
|
||||
|
@ -80,11 +80,7 @@ export const VcmoveCmd = utilityCmd({
|
|||
newChannel: channel,
|
||||
});
|
||||
|
||||
sendSuccessMessage(
|
||||
pluginData,
|
||||
msg.channel,
|
||||
`**${renderUserUsername(args.member.user)}** moved to **${channel.name}**`,
|
||||
);
|
||||
sendSuccessMessage(pluginData, msg.channel, `**${renderUsername(args.member)}** moved to **${channel.name}**`);
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -157,7 +153,7 @@ export const VcmoveAllCmd = utilityCmd({
|
|||
sendErrorMessage(
|
||||
pluginData,
|
||||
msg.channel,
|
||||
`Failed to move ${renderUserUsername(currMember.user)} (${currMember.id}): You cannot act on this member`,
|
||||
`Failed to move ${renderUsername(currMember)} (${currMember.id}): You cannot act on this member`,
|
||||
);
|
||||
errAmt++;
|
||||
continue;
|
||||
|
@ -172,11 +168,7 @@ export const VcmoveAllCmd = utilityCmd({
|
|||
sendErrorMessage(pluginData, msg.channel, "Unknown error when trying to move members");
|
||||
return;
|
||||
}
|
||||
sendErrorMessage(
|
||||
pluginData,
|
||||
msg.channel,
|
||||
`Failed to move ${renderUserUsername(currMember.user)} (${currMember.id})`,
|
||||
);
|
||||
sendErrorMessage(pluginData, msg.channel, `Failed to move ${renderUsername(currMember)} (${currMember.id})`);
|
||||
errAmt++;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue