Skip to content

Commit

Permalink
fix and update
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasB25 committed Aug 20, 2024
1 parent 205018d commit a6acfb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Lavalink/example.application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ lavalink:
plugins:
- dependency: "com.github.appujet:jiosaavn-plugin:0.1.7"
repository: "https://jitpack.io"
- dependency: "com.dunctebot:skybot-lavalink-plugin:1.7.0"
- dependency: "com.dunctebot:skybot-lavalink-plugin:1.7.1"
snapshot: false # set to true if you want to use snapshot builds.
- dependency: "com.github.topi314.lavasearch:lavasearch-plugin:1.0.0"
snapshot: false # set to true if you want to use snapshot builds.
Expand Down
30 changes: 9 additions & 21 deletions src/commands/dev/CreateInvite.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Command, type Context, type Lavamusic } from "../../structures/index.js";
import { ChannelType, PermissionFlagsBits } from "discord.js";
import { ChannelType, PermissionFlagsBits, type TextChannel } from "discord.js";

export default class CreateInvite extends Command {
constructor(client: Lavamusic) {
super(client, {
name: "createinvite",
description: {
content: "Create an invite link for a guild",
examples: ["createinvite 0123456789"],
examples: ["createinvite 0000000000000000000"],
usage: "createinvite <guildId>",
},
category: "dev",
Expand Down Expand Up @@ -36,31 +36,21 @@ export default class CreateInvite extends Command {

if (!guild) {
return await ctx.sendMessage({
embeds: [
this.client.embed()
.setColor(client.color.red)
.setDescription("Guild not found"),
],
embeds: [this.client.embed().setColor(this.client.color.red).setDescription("Guild not found")],
});
}

const textChannel = guild.channels.cache.find(
(c) =>
c.type === ChannelType.GuildText &&
c.permissionsFor(guild.members.me!)?.has([
PermissionFlagsBits.CreateInstantInvite,
PermissionFlagsBits.SendMessages,
PermissionFlagsBits.ViewChannel,
])
);
c
.permissionsFor(guild.members.me!)
?.has([PermissionFlagsBits.CreateInstantInvite, PermissionFlagsBits.SendMessages, PermissionFlagsBits.ViewChannel]),
) as TextChannel;

if (!textChannel) {
return await ctx.sendMessage({
embeds: [
this.client.embed()
.setColor(client.color.red)
.setDescription("No suitable channel found"),
],
embeds: [this.client.embed().setColor(this.client.color.red).setDescription("No suitable channel found")],
});
}

Expand All @@ -72,9 +62,7 @@ export default class CreateInvite extends Command {

return await ctx.sendMessage({
embeds: [
this.client.embed()
.setColor(client.color.main)
.setDescription(`Invite link for ${guild.name}: [Link](${invite.url})`),
this.client.embed().setColor(this.client.color.main).setDescription(`Invite link for ${guild.name}: [Link](${invite.url})`),
],
});
}
Expand Down

0 comments on commit a6acfb0

Please sign in to comment.