-
Notifications
You must be signed in to change notification settings - Fork 0
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
12 changed files
with
108 additions
and
37 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,23 @@ | ||
import Button from '../Private/Button'; | ||
import ButtonData from '../Private/ButtonData'; | ||
import DiscordManager from '../DiscordManager'; | ||
import { ButtonInteraction } from 'discord.js'; | ||
|
||
class InfoButton extends Button { | ||
constructor(discord: DiscordManager) { | ||
super(discord); | ||
this.data = new ButtonData('info'); | ||
} | ||
|
||
async execute(interaction: ButtonInteraction): Promise<void> { | ||
const command = interaction.client.commands.get(interaction.customId); | ||
if (command === undefined) { | ||
await interaction.reply({ content: 'Button not found.', ephemeral: true }); | ||
return; | ||
} | ||
await interaction.deferReply({ ephemeral: true }); | ||
await command.execute(interaction); | ||
} | ||
} | ||
|
||
export default InfoButton; |
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
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 was deleted.
Oops, something went wrong.
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,66 @@ | ||
import Command from '../Private/Command'; | ||
import CommandData from '../Private/CommandData'; | ||
import DiscordManager from '../DiscordManager'; | ||
import Embed from '../Private/Embed'; | ||
import { ButtonInteraction, ChatInputCommandInteraction } from 'discord.js'; | ||
|
||
class InfoCommand extends Command { | ||
constructor(discord: DiscordManager) { | ||
super(discord); | ||
this.data = new CommandData().setName('info').setDescription('info'); | ||
} | ||
|
||
async execute(interaction: ChatInputCommandInteraction | ButtonInteraction): Promise<void> { | ||
const app = await interaction.client.application.fetch(); | ||
await interaction.followUp({ | ||
embeds: [ | ||
new Embed({ | ||
title: 'Spotify Manager', | ||
description: `Spotify Manager made with :purple_heart: by <@1276524855445164098>\nOpen source on [Github](https://github.com/Kathund/Spotify-Manager)\n\n**Stats:**\nServers: ${ | ||
app.approximateGuildCount || 0 | ||
}\nUser Installs: ${app.approximateUserInstallCount || 0}` | ||
}).addFields( | ||
{ | ||
name: 'Buttons', | ||
value: `${this.discord.emojis.get( | ||
'shuffle' | ||
)} Shuffle Button | Toggles the shuffle mode between off and on!\n${this.discord.emojis.get( | ||
'back' | ||
)} Previous Song Button | Go back a song\n${this.discord.emojis.get( | ||
'pause' | ||
)} Pause Button | Pause the music\n${this.discord.emojis.get( | ||
'play' | ||
)} Play Button | Play the music\n${this.discord.emojis.get( | ||
'forward' | ||
)} Skip Song Button | Skip the current song\n${this.discord.emojis.get( | ||
'repeatOne' | ||
)} Repeat One Button | Toggles between being on Repeat Track and Repeat Context\n${this.discord.emojis.get( | ||
'refresh' | ||
)} Refresh Button | Refreshes playback info\n${this.discord.emojis.get( | ||
'queue' | ||
)} Queue Button | View upcomming queue\n${this.discord.emojis.get( | ||
'spotify' | ||
)} Spotify Button | Opens the current song's url\n${this.discord.emojis.get( | ||
'info' | ||
)} Info Button | Displays this info embed` | ||
}, | ||
{ | ||
name: 'Emojis', | ||
value: `${this.discord.emojis.get( | ||
'explicit' | ||
)} | Shows if the song is tagged explicit\n${this.discord.emojis.get( | ||
'local' | ||
)} | Shows if the song is a local file` | ||
}, | ||
{ | ||
name: 'Credits', | ||
value: 'Default Emojis/Button Icons are sourced from [Icons discord server](https://discord.gg/aPvvhefmt3)' | ||
} | ||
) | ||
], | ||
ephemeral: interaction.isButton() | ||
}); | ||
} | ||
} | ||
|
||
export default InfoCommand; |
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