chore: prettier
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
1fd04bf5d5
commit
21390fed8a
3 changed files with 25 additions and 15 deletions
|
@ -49,9 +49,15 @@ export const reuploadCommands = async () => {
|
|||
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers)
|
||||
.setDMPermission(false),
|
||||
new SlashCommandBuilder().setName('joke').setDescription("it's a joke"),
|
||||
new SlashCommandBuilder().setName('rory').setDescription("Gets a Rory photo!")
|
||||
new SlashCommandBuilder()
|
||||
.setName('rory')
|
||||
.setDescription('Gets a Rory photo!')
|
||||
.addStringOption((option) =>
|
||||
option.setName("id").setDescription("specify a Rory ID").setRequired(false)),
|
||||
option
|
||||
.setName('id')
|
||||
.setDescription('specify a Rory ID')
|
||||
.setRequired(false)
|
||||
),
|
||||
].map((command) => command.toJSON());
|
||||
|
||||
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN!);
|
||||
|
|
|
@ -28,11 +28,13 @@ const javaAnalyzer: Analyzer = async (text) => {
|
|||
'Wrong Java Version',
|
||||
`Please switch to the following: \`${ver}\`\nFor more information, type \`/tag java\``,
|
||||
];
|
||||
} else if (text.includes('Java major version is incompatible. Things might break.')) {
|
||||
} else if (
|
||||
text.includes('Java major version is incompatible. Things might break.')
|
||||
) {
|
||||
return [
|
||||
'Java compatibility check skipped',
|
||||
'The Java major version may not work with your Minecraft instance. Please switch to a compatible version'
|
||||
]
|
||||
'The Java major version may not work with your Minecraft instance. Please switch to a compatible version',
|
||||
];
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
|
|
@ -28,21 +28,19 @@ export async function expandDiscordLink(message: Message): Promise<void> {
|
|||
let n = 0;
|
||||
|
||||
for (const r of results) {
|
||||
if (n >= 3)
|
||||
break; // only process three previews
|
||||
if (n >= 3) break; // only process three previews
|
||||
|
||||
if (r.groups == undefined || r.groups.server_id != message.guildId)
|
||||
continue; // do not let the bot leak messages from one server to another
|
||||
|
||||
const channel = await message.guild?.channels.fetch(
|
||||
r.groups.channel_id
|
||||
);
|
||||
const channel = await message.guild?.channels.fetch(r.groups.channel_id);
|
||||
|
||||
if (!channel || !channel.isTextBased())
|
||||
continue;
|
||||
if (!channel || !channel.isTextBased()) continue;
|
||||
|
||||
if (channel instanceof ThreadChannel) {
|
||||
if (!channel.parent?.members?.some((user) => user.id == message.author.id))
|
||||
if (
|
||||
!channel.parent?.members?.some((user) => user.id == message.author.id)
|
||||
)
|
||||
continue; // do not reveal a message to a user who can't see it
|
||||
} else {
|
||||
if (!channel.members?.some((user) => user.id == message.author.id))
|
||||
|
@ -59,7 +57,7 @@ export async function expandDiscordLink(message: Message): Promise<void> {
|
|||
})
|
||||
.setColor(Colors.Aqua)
|
||||
.setTimestamp(messageToShow.createdTimestamp)
|
||||
.setFooter({ text: `#${messageToShow.channel.name}`})
|
||||
.setFooter({ text: `#${messageToShow.channel.name}` });
|
||||
if (messageToShow.content) {
|
||||
builder.setDescription(messageToShow.content);
|
||||
}
|
||||
|
@ -84,7 +82,11 @@ export async function expandDiscordLink(message: Message): Promise<void> {
|
|||
.setURL(messageToShow.url)
|
||||
);
|
||||
|
||||
await message.reply({ embeds: [builder], components: [row], allowedMentions: {repliedUser: false}});
|
||||
await message.reply({
|
||||
embeds: [builder],
|
||||
components: [row],
|
||||
allowedMentions: { repliedUser: false },
|
||||
});
|
||||
n++;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue