-
-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
658 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { Command, Lavamusic, Context } from "../../structures/index.js"; | ||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js"; | ||
|
||
|
||
export default class About extends Command { | ||
constructor(client: Lavamusic) { | ||
super(client, { | ||
name: "about", | ||
description: { | ||
content: "Shows information about the bot", | ||
examples: ["about"], | ||
usage: "about" | ||
}, | ||
category: "info", | ||
aliases: ["ab"], | ||
cooldown: 3, | ||
args: false, | ||
player: { | ||
voice: false, | ||
dj: false, | ||
active: false, | ||
djPerm: null | ||
}, | ||
permissions: { | ||
dev: false, | ||
client: ["SendMessages", "ViewChannel", "EmbedLinks"], | ||
user: [] | ||
}, | ||
slashCommand: true, | ||
options: [] | ||
}); | ||
}; | ||
public async run(client: Lavamusic, ctx: Context, args: string[]): Promise<void> { | ||
|
||
const row = new ActionRowBuilder().addComponents( | ||
new ButtonBuilder() | ||
.setLabel("Invite Lavamusic") | ||
.setStyle(ButtonStyle.Link) | ||
.setURL(`https://discord.com/api/oauth2/authorize?client_id=875635121770889257&permissions=8&scope=bot%20applications.commands`), | ||
new ButtonBuilder() | ||
.setLabel("Support Server") | ||
.setStyle(ButtonStyle.Link) | ||
.setURL("https://discord.gg/ns8CTk9J3e")) | ||
|
||
const embed = this.client.embed() | ||
.setAuthor({ name: 'LavaMusic', iconURL: 'https://media.discordapp.net/attachments/876035356460462090/888434725235097610/20210820_124325.png' }) | ||
.setThumbnail('https://media.discordapp.net/attachments/876035356460462090/888434725235097610/20210820_124325.png') | ||
.setColor(this.client.color.main) | ||
.addFields([ | ||
{ name: 'Creator', value: '[Blacky#9125](https://github.com/brblacky)', inline: true }, | ||
{ name: 'Repository', value: '[Here](https://github.com/brblacky/lavamusic)', inline: true }, | ||
{ name: 'Support', value: '[Here](https://discord.gg/ns8CTk9J3e)', inline: true }, | ||
{ name: '\u200b', value: `He really wanted to make his first open source project ever for more coding experience. In this project, he was challenged to make a project with less bugs. Hope you enjoy using LavaMusic!`, inline: true }, | ||
]); | ||
return await ctx.sendMessage({ content: '', embeds: [embed], components: [row] }); | ||
} | ||
} | ||
|
||
/** | ||
* Project: lavamusic | ||
* Author: Blacky | ||
* Company: Coders | ||
* Copyright (c) 2023. All rights reserved. | ||
* This code is the property of Coder and may not be reproduced or | ||
* modified without permission. For more information, contact us at | ||
* https://discord.gg/ns8CTk9J3e | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { Command, Lavamusic, Context } from "../../structures/index.js"; | ||
import os from "os"; | ||
import { version } from "discord.js"; | ||
|
||
export default class Info extends Command { | ||
constructor(client: Lavamusic) { | ||
super(client, { | ||
name: "info", | ||
description: { | ||
content: "Ingormation about the bot", | ||
examples: ["info"], | ||
usage: "info" | ||
}, | ||
category: "info", | ||
aliases: ["botinfo", "bi"], | ||
cooldown: 3, | ||
args: false, | ||
player: { | ||
voice: false, | ||
dj: false, | ||
active: false, | ||
djPerm: null | ||
}, | ||
permissions: { | ||
dev: false, | ||
client: ["SendMessages", "ViewChannel", "EmbedLinks"], | ||
user: [] | ||
}, | ||
slashCommand: true, | ||
options: [] | ||
}); | ||
}; | ||
public async run(client: Lavamusic, ctx: Context, args: string[]): Promise<void> { | ||
const osType = os.type(); | ||
const osRelease = os.release(); | ||
const osUptime = os.uptime(); | ||
const osHostname = os.hostname(); | ||
const cpuArch = os.arch(); | ||
const cpuCores = os.cpus().length; | ||
const totalMem = os.totalmem(); | ||
const freeMem = os.freemem(); | ||
const usedMem = totalMem - freeMem; | ||
const nodeVersion = process.version; | ||
const discordJsVersion = version; | ||
const botGuilds = client.guilds.cache.size; | ||
const botChannels = client.channels.cache.size; | ||
const botUsers = client.users.cache.size; | ||
const botCommands = client.commands.size; | ||
|
||
const botInfo = `Bot Information: | ||
- **Operating System**: ${osType} ${osRelease} | ||
- **Uptime**: ${client.utils.formatTime(osUptime)} | ||
- **Hostname**: ${osHostname} | ||
- **CPU Architecture**: ${cpuArch} (${cpuCores} cores) | ||
- **Memory Usage**: ${client.utils.formatBytes(usedMem)} / ${client.utils.formatBytes(totalMem)} (${Math.round((usedMem / totalMem) * 100)}%) | ||
- **Node.js Version**: ${nodeVersion} | ||
- **Discord.js Version**: ${discordJsVersion} | ||
- **Connected to** ${botGuilds} guilds, ${botChannels} channels, and ${botUsers} users | ||
- **Total Commands**: ${botCommands} | ||
`; | ||
|
||
const embed = this.client.embed(); | ||
return ctx.sendMessage({ embeds: [embed.setColor(this.client.color.main).setDescription(botInfo)] }); | ||
} | ||
} | ||
|
||
/** | ||
* Project: lavamusic | ||
* Author: Blacky | ||
* Company: Coders | ||
* Copyright (c) 2023. All rights reserved. | ||
* This code is the property of Coder and may not be reproduced or | ||
* modified without permission. For more information, contact us at | ||
* https://discord.gg/ns8CTk9J3e | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { Command, Lavamusic, Context } from "../../structures/index.js"; | ||
import { ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js"; | ||
|
||
export default class Invite extends Command { | ||
constructor(client: Lavamusic) { | ||
super(client, { | ||
name: "invite", | ||
description: { | ||
content: "Sends the bot's invite link", | ||
examples: ["invite"], | ||
usage: "invite" | ||
}, | ||
category: "info", | ||
aliases: ["inv"], | ||
cooldown: 3, | ||
args: false, | ||
player: { | ||
voice: false, | ||
dj: false, | ||
active: false, | ||
djPerm: null | ||
}, | ||
permissions: { | ||
dev: false, | ||
client: ["SendMessages", "ViewChannel", "EmbedLinks"], | ||
user: [] | ||
}, | ||
slashCommand: true, | ||
options: [] | ||
}); | ||
}; | ||
public async run(client: Lavamusic, ctx: Context, args: string[]): Promise<void> { | ||
|
||
const embed = this.client.embed(); | ||
const row = new ActionRowBuilder().addComponents( | ||
new ButtonBuilder() | ||
.setLabel("Invite Lavamusic") | ||
.setStyle(ButtonStyle.Link) | ||
.setURL(`https://discord.com/api/oauth2/authorize?client_id=875635121770889257&permissions=8&scope=bot%20applications.commands`), | ||
new ButtonBuilder() | ||
.setLabel("Support Server") | ||
.setStyle(ButtonStyle.Link) | ||
.setURL("https://discord.gg/ns8CTk9J3e")) | ||
|
||
return ctx.sendMessage({ embeds: [embed.setColor(this.client.color.main).setDescription(`[Invite Lavamusic](https://discord.com/api/oauth2/authorize?client_id=875635121770889257&permissions=8&scope=bot%20applications.commands) | [Support Server](https://discord.gg/ns8CTk9J3e)`)], components: [row] }); | ||
} | ||
}; | ||
|
||
/** | ||
* Project: lavamusic | ||
* Author: Blacky | ||
* Company: Coders | ||
* Copyright (c) 2023. All rights reserved. | ||
* This code is the property of Coder and may not be reproduced or | ||
* modified without permission. For more information, contact us at | ||
* https://discord.gg/ns8CTk9J3e | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Command, Lavamusic, Context } from "../../structures/index.js"; | ||
|
||
|
||
export default class AddRole extends Command { | ||
constructor(client: Lavamusic) { | ||
super(client, { | ||
name: "addrole", | ||
description: { | ||
content: "Adds a role to a user", | ||
examples: ["addrole @user @role"], | ||
usage: "addrole <user> <role>" | ||
}, | ||
category: "moderator", | ||
aliases: ["ar"], | ||
cooldown: 3, | ||
args: true, | ||
player: { | ||
voice: false, | ||
dj: false, | ||
active: false, | ||
djPerm: null | ||
}, | ||
permissions: { | ||
dev: false, | ||
client: ["SendMessages", "ViewChannel", "EmbedLinks", "ManageRoles"], | ||
user: ["ManageRoles"] | ||
}, | ||
slashCommand: false, | ||
options: [] | ||
}); | ||
}; | ||
public async run(client: Lavamusic, ctx: Context, args: string[]): Promise<void> { | ||
|
||
const embed = this.client.embed(); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { Lavamusic, Context, Command } from "../../structures/index.js"; | ||
|
||
|
||
export default class Pause extends Command { | ||
constructor(client: Lavamusic) { | ||
super(client, { | ||
name: "pause", | ||
description: { | ||
content: "Pauses the current song", | ||
examples: ["pause"], | ||
usage: "pause" | ||
}, | ||
category: "music", | ||
aliases: [], | ||
cooldown: 3, | ||
args: false, | ||
player: { | ||
voice: true, | ||
dj: false, | ||
active: true, | ||
djPerm: null | ||
}, | ||
permissions: { | ||
dev: false, | ||
client: ["SendMessages", "ViewChannel", "EmbedLinks"], | ||
user: [] | ||
}, | ||
slashCommand: true, | ||
options: [] | ||
}); | ||
}; | ||
public async run(client: Lavamusic, ctx: Context, args: string[]): Promise<void> { | ||
|
||
const player = client.queue.get(ctx.guild.id); | ||
const embed = this.client.embed(); | ||
if (!player.paused) { | ||
player.pause(); | ||
return ctx.sendMessage({ embeds: [embed.setColor(this.client.color.main).setDescription(`Paused the song`)] }); | ||
} else { | ||
return ctx.sendMessage({ embeds: [embed.setColor(this.client.color.red).setDescription(`The song is already paused`)] }); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Project: lavamusic | ||
* Author: Blacky | ||
* Company: Coders | ||
* Copyright (c) 2023. All rights reserved. | ||
* This code is the property of Coder and may not be reproduced or | ||
* modified without permission. For more information, contact us at | ||
* https://discord.gg/ns8CTk9J3e | ||
*/ |
Oops, something went wrong.