Finish documentation, clean up commands

main
DaXcess 2022-11-08 14:13:13 +01:00
parent b57b4127c6
commit 66e4579e5a
6 changed files with 68 additions and 29 deletions

39
CONTRIBUTING.md 100644
View File

@ -0,0 +1,39 @@
# Contributing
## How to contribute
### By reporting bugs
If you find a bug, please report it to the [issue tracker](https://github.com/SpoticordMusic/spoticord) on GitHub. When reporting bugs, it is recommended that you make use of the provided template.
When filing your bug, please be as precise as possible. Bugs that can be reproduced by anyone are much easier to fix. If you can, please include a minimal test case that demonstrates the bug. This makes it much easier to track down the bug.
### By suggesting new features
If you have an idea for a new feature, please suggest it by creating a new issue on the [issue tracker][issues] on GitHub. When suggesting new features, it is recommended that you make use of the provided template. If you think that your feature is related to an existing issue, please mention it in your description.
If you want to suggest new features more casually, rather than officially here on GitHub, you can join our [Discord server](https://discord.gg/wRCyhVqBZ5) and discuss your ideas with us there.
### By writing code
If you want to contribute code, you can do so through GitHub by forking the repository and sending a pull request.
It is generally recommended that you create an issue on the [issue tracker](https://github.com/SpoticordMusic/spoticord) on GitHub before you start working on a feature. This allows us to discuss the feature and make sure that it is something that we want to add to the project. If you are not sure whether a feature is something that we want to add, you can always ask us on our [Discord server](https://discord.gg/wRCyhVqBZ5).
The flow will look something like this:
1. Fork the repository on GitHub
2. Create a named feature branch (like `add_component_x`)
3. Write your change
4. Test your change
5. Submit a Pull Request to the dev branch
A member of the team will review your pull request and either merge it, request changes to it, or close it with an explanation.
### Code style
When writing code we ask you to code in a way that is consistent with the rest of the codebase. This means that you should use the same indentation style, naming conventions, etc. as the rest of the codebase.
We make use of `rustfmt` to format our code. You can install it by running `rustup component add rustfmt` and then running `cargo fmt --all` to format your code. It is generally recommended to run this command before you commit your code. If you use VSCode, you can install the [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer) extension and enable the `Format on Save` option.
Also, **please do not write code that may panic**. If you are not sure how to handle a case, please use `Result` or `Option` to handle it.

View File

@ -19,8 +19,14 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
EmbedBuilder::new() EmbedBuilder::new()
.title("Spoticord Help") .title("Spoticord Help")
.icon_url("https://spoticord.com/img/logo-standard.webp") .icon_url("https://spoticord.com/img/logo-standard.webp")
.description(format!("Click **[here](https://spoticord.com/commands)** for a list of commands.\n{}", .description(format!("**Welcome to Spoticord**
"If you need help setting Spoticord up you can check out the **[Documentation](https://spoticord.com/documentation)** page on the Spoticord website.\n\n")) It seems you have requested some help. Not to worry, we can help you out.\n
**Not sure how the bot works?**
**[Click here](https://spoticord.com/#how-to)** for a quick overview about how to set up Spoticord and how to use it.\n
**Which commands are there?**
You can find all **[the commands](https://spoticord.com/#commands)** on the website. You may also just type `/` in Discord and see which commands are available there.\n
**Need more help?**
If you still need some help, whether you are having issues with the bot or you just want to give us some feedback, you can join our **[Discord server](https://discord.gg/wRCyhVqBZ5)**."))
.status(Status::Info) .status(Status::Info)
.build(), .build(),
false, false,

View File

@ -44,7 +44,7 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
EmbedBuilder::new() EmbedBuilder::new()
.title("Link your Spotify account") .title("Link your Spotify account")
.title_url(&link) .title_url(&link)
.icon_url("https://spoticord.com/img/spotify-logo.png") .icon_url("https://spoticord.com/spotify-logo.png")
.description(format!( .description(format!(
"Go to [this link]({}) to connect your Spotify account.", "Go to [this link]({}) to connect your Spotify account.",
link link
@ -111,7 +111,7 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
EmbedBuilder::new() EmbedBuilder::new()
.title("Link your Spotify account") .title("Link your Spotify account")
.title_url(&link) .title_url(&link)
.icon_url("https://spoticord.com/img/spotify-logo.png") .icon_url("https://spoticord.com/spotify-logo.png")
.description(format!( .description(format!(
"Go to [this link]({}) to connect your Spotify account.", "Go to [this link]({}) to connect your Spotify account.",
link link

View File

@ -30,7 +30,6 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
&command, &command,
EmbedBuilder::new() EmbedBuilder::new()
.title("Cannot join voice channel") .title("Cannot join voice channel")
.icon_url("https://spoticord.com/static/image/prohibited.png")
.description("You need to connect to a voice channel") .description("You need to connect to a voice channel")
.status(Status::Error) .status(Status::Error)
.build(), .build(),
@ -61,7 +60,6 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
&command, &command,
EmbedBuilder::new() EmbedBuilder::new()
.title("Cannot join voice channel") .title("Cannot join voice channel")
.icon_url("https://spoticord.com/static/image/prohibited.png")
.description(msg) .description(msg)
.status(Status::Error) .status(Status::Error)
.build(), .build(),
@ -80,7 +78,6 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
&command, &command,
EmbedBuilder::new() EmbedBuilder::new()
.title("Cannot join voice channel") .title("Cannot join voice channel")
.icon_url("https://spoticord.com/static/image/prohibited.png")
.description( .description(
format!( format!(
"You are already playing music in another server ({}).\nStop playing in that server first before joining this one.", "You are already playing music in another server ({}).\nStop playing in that server first before joining this one.",
@ -115,7 +112,6 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
&command, &command,
EmbedBuilder::new() EmbedBuilder::new()
.title("Cannot join voice channel") .title("Cannot join voice channel")
.icon_url("https://spoticord.com/static/image/prohibited.png")
.description("You need to link your Spotify account. Use </link:1036714850367320136> or go to [the accounts website](https://account.spoticord.com/) to get started.") .description("You need to link your Spotify account. Use </link:1036714850367320136> or go to [the accounts website](https://account.spoticord.com/) to get started.")
.status(Status::Error) .status(Status::Error)
.build(), .build(),
@ -131,7 +127,6 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
&command, &command,
EmbedBuilder::new() EmbedBuilder::new()
.title("Cannot join voice channel") .title("Cannot join voice channel")
.icon_url("https://spoticord.com/static/image/prohibited.png")
.description("An error occured while joining the channel. Please try again later.") .description("An error occured while joining the channel. Please try again later.")
.status(Status::Error) .status(Status::Error)
.build(), .build(),
@ -159,7 +154,6 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
&command, &command,
EmbedBuilder::new() EmbedBuilder::new()
.title("Cannot join voice channel") .title("Cannot join voice channel")
.icon_url("https://spoticord.com/static/image/prohibited.png")
.description("You need to link your Spotify account. Use </link:1036714850367320136> or go to [the accounts website](https://account.spoticord.com/) to get started.") .description("You need to link your Spotify account. Use </link:1036714850367320136> or go to [the accounts website](https://account.spoticord.com/) to get started.")
.status(Status::Error) .status(Status::Error)
.build(), .build(),
@ -175,7 +169,6 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
&command, &command,
EmbedBuilder::new() EmbedBuilder::new()
.title("Cannot join voice channel") .title("Cannot join voice channel")
.icon_url("https://spoticord.com/static/image/prohibited.png")
.description("An error occured while joining the channel. Please try again later.") .description("An error occured while joining the channel. Please try again later.")
.status(Status::Error) .status(Status::Error)
.build(), .build(),
@ -191,7 +184,7 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
&command, &command,
EmbedBuilder::new() EmbedBuilder::new()
.title("Connected to voice channel") .title("Connected to voice channel")
.icon_url("https://spoticord.com/static/image/speaker.png") .icon_url("https://spoticord.com/speaker.png")
.description(format!("Come listen along in <#{}>", channel_id)) .description(format!("Come listen along in <#{}>", channel_id))
.footer("Spotify will automatically start playing on Spoticord") .footer("Spotify will automatically start playing on Spoticord")
.status(Status::Info) .status(Status::Info)

View File

@ -25,7 +25,6 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
&command, &command,
EmbedBuilder::new() EmbedBuilder::new()
.title("Cannot disconnect bot") .title("Cannot disconnect bot")
.icon_url("https://tabler-icons.io/static/tabler-icons/icons/ban.svg")
.description("I'm currently not connected to any voice channel") .description("I'm currently not connected to any voice channel")
.status(Status::Error) .status(Status::Error)
.build(), .build(),

View File

@ -149,22 +149,24 @@ pub fn run(ctx: Context, command: ApplicationCommandInteraction) -> CommandOutpu
response response
.kind(InteractionResponseType::ChannelMessageWithSource) .kind(InteractionResponseType::ChannelMessageWithSource)
.interaction_response_data(|message| { .interaction_response_data(|message| {
message message.embed(|embed| {
.embed(|embed| embed embed
.author(|author| author .author(|author| {
.name("Currently Playing") author
.icon_url("https://www.freepnglogos.com/uploads/spotify-logo-png/file-spotify-logo-png-4.png") .name("Currently Playing")
) .icon_url("https://spoticord.com/spotify-logo.png")
.title(title) })
.url(format!("https://open.spotify.com/{}/{}", audio_type, spotify_id.to_base62().unwrap())) .title(title)
.description(description) .url(format!(
.footer(|footer| footer "https://open.spotify.com/{}/{}",
.text(&owner.name) audio_type,
.icon_url(owner.face()) spotify_id.to_base62().unwrap()
) ))
.thumbnail(&thumbnail) .description(description)
.color(Status::Info as u64) .footer(|footer| footer.text(&owner.name).icon_url(owner.face()))
) .thumbnail(&thumbnail)
.color(Status::Info as u64)
})
}) })
}) })
.await .await