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)
|
.setDefaultMemberPermissions(PermissionFlagsBits.ModerateMembers)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
new SlashCommandBuilder().setName('joke').setDescription("it's a joke"),
|
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) =>
|
.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());
|
].map((command) => command.toJSON());
|
||||||
|
|
||||||
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN!);
|
const rest = new REST({ version: '10' }).setToken(process.env.DISCORD_TOKEN!);
|
||||||
|
|
|
@ -28,11 +28,13 @@ const javaAnalyzer: Analyzer = async (text) => {
|
||||||
'Wrong Java Version',
|
'Wrong Java Version',
|
||||||
`Please switch to the following: \`${ver}\`\nFor more information, type \`/tag java\``,
|
`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 [
|
return [
|
||||||
'Java compatibility check skipped',
|
'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;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,21 +28,19 @@ export async function expandDiscordLink(message: Message): Promise<void> {
|
||||||
let n = 0;
|
let n = 0;
|
||||||
|
|
||||||
for (const r of results) {
|
for (const r of results) {
|
||||||
if (n >= 3)
|
if (n >= 3) break; // only process three previews
|
||||||
break; // only process three previews
|
|
||||||
|
|
||||||
if (r.groups == undefined || r.groups.server_id != message.guildId)
|
if (r.groups == undefined || r.groups.server_id != message.guildId)
|
||||||
continue; // do not let the bot leak messages from one server to another
|
continue; // do not let the bot leak messages from one server to another
|
||||||
|
|
||||||
const channel = await message.guild?.channels.fetch(
|
const channel = await message.guild?.channels.fetch(r.groups.channel_id);
|
||||||
r.groups.channel_id
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!channel || !channel.isTextBased())
|
if (!channel || !channel.isTextBased()) continue;
|
||||||
continue;
|
|
||||||
|
|
||||||
if (channel instanceof ThreadChannel) {
|
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
|
continue; // do not reveal a message to a user who can't see it
|
||||||
} else {
|
} else {
|
||||||
if (!channel.members?.some((user) => user.id == message.author.id))
|
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)
|
.setColor(Colors.Aqua)
|
||||||
.setTimestamp(messageToShow.createdTimestamp)
|
.setTimestamp(messageToShow.createdTimestamp)
|
||||||
.setFooter({ text: `#${messageToShow.channel.name}`})
|
.setFooter({ text: `#${messageToShow.channel.name}` });
|
||||||
if (messageToShow.content) {
|
if (messageToShow.content) {
|
||||||
builder.setDescription(messageToShow.content);
|
builder.setDescription(messageToShow.content);
|
||||||
}
|
}
|
||||||
|
@ -84,7 +82,11 @@ export async function expandDiscordLink(message: Message): Promise<void> {
|
||||||
.setURL(messageToShow.url)
|
.setURL(messageToShow.url)
|
||||||
);
|
);
|
||||||
|
|
||||||
await message.reply({ embeds: [builder], components: [row], allowedMentions: {repliedUser: false}});
|
await message.reply({
|
||||||
|
embeds: [builder],
|
||||||
|
components: [row],
|
||||||
|
allowedMentions: { repliedUser: false },
|
||||||
|
});
|
||||||
n++;
|
n++;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue