Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Starboard-4
A feature-rich and reliable Starboard bot, trusted by thousands of servers.
# starboard-4
A pretty good starboard bot.

- [Invite Starboard](https://discord.com/api/oauth2/authorize?client_id=700796664276844612&permissions=275683339328&scope=applications.commands%20bot)
- [Get Support](https://discord.gg/3gK8mSA)
- [Documentation](https://starboard.best)
- [invite](https://discord.com/api/oauth2/authorize?client_id=700796664276844612&permissions=275683339328&scope=applications.commands%20bot)
- [support](https://discord.gg/3gK8mSA)
- [docs](https://starboard.best)

## Features
- Multiple starboards per server
Expand Down
1 change: 0 additions & 1 deletion compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ services:
environment:
SB_DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
restart: unless-stopped
depends_on: [postgres]

volumes:
postgres-data:
2 changes: 0 additions & 2 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ pub const INVITE_URL: &str = "https://discord.com/api/oauth2/authorize?client_id
pub const SUPPORT_URL: &str = "https://discord.gg/3gK8mSA";
pub const SOURCE_URL: &str = "https://github.com/CircuitSacul/Starboard-4";
pub const PATREON_URL: &str = "https://patreon.com/CircuitSacul";
pub const VOTE_URL: &str = "https://top.gg/bot/700796664276844612/vote";
pub const REVIEW_URL: &str = "https://top.gg/bot/700796664276844612#reviews";

// Docs
pub const DOCS_URL: &str = "https://docs.starboard.best";
Expand Down
4 changes: 2 additions & 2 deletions src/core/emoji.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn qualify_emoji(target: &str) -> &str {
}

pub fn compare_unicode_emojis(left: &str, right: &str) -> bool {
qualify_emoji(left) == qualify_emoji(right)
remove_v16(qualify_emoji(left)) == remove_v16(qualify_emoji(right))
}

#[derive(Clone)]
Expand Down Expand Up @@ -106,7 +106,7 @@ impl SimpleEmoji {
}
} else {
RequestReactionType::Unicode {
name: remove_v16(qualify_emoji(&self.raw)),
name: qualify_emoji(&self.raw),
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/database/validation/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ pub fn validate_name(name: &str) -> Result<String, String> {
.filter(|c| c.is_ascii_digit() || c.is_ascii_lowercase() || *c == '_' || *c == '-')
.collect();

if filtered.len() < 3 {
Err("The name must be at least 3 characters (special characters are excluded).".to_string())
if filtered.len() < constants::MIN_NAME_LENGTH as usize {
Err(format!(
"The name must be at least {} characters (special characters are excluded).",
constants::MIN_NAME_LENGTH
))
} else {
Ok(filtered)
}
Expand Down
28 changes: 10 additions & 18 deletions src/interactions/commands/chat/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,29 @@ pub struct Help;
impl Help {
pub async fn callback(self, mut ctx: CommandCtx) -> StarboardResult<()> {
let emb = embed::build()
.title("Starboard - The Best Discord Starboard")
.description("Starboard is a reliable and feature-rich starboard bot for Discord.")
.title("Starboard")
.description("A pretty good starboard bot.")
.field(EmbedFieldBuilder::new(
"Useful Commands",
"Getting Started",
concat!(
"`/starboards view`: View all of your starboards.\n",
"`/starboards create`: Create a new starboard.\n",
"`/starboards edit`: Edit the configuration for a starboard.\n",
"Get started by running `/starboards create` to create a starboard, and\n",
"then `/starboards edit requirements` to change requirement settings.\n",
"- `required`: how many upvotes a message needs\n",
"- `upvote-emojis`: what emojis count as upvotes\n",
"- `self-vote`: whether you can vote on your own messages\n\n",
"All other commands and settings are available in the docs."
),
))
.field(EmbedFieldBuilder::new(
"Starboard's Features",
"Features",
concat!(
"Starboard's key free features are:\n",
"- Multiple starboards\n",
"- Custom avatar/username for starboards (via webhooks)\n",
"- Autostar channels\n",
"- Complete per-channel starboard configuration\n",
"- Limited per-role starboard configuration\n",
),
))
.field(EmbedFieldBuilder::new(
"Support Starboard",
concat_format!(
"If you like Starboard and want to support it, you can do ";
"so by [voting]({}) or " <- constants::VOTE_URL;
"[leaving a review]({}) " <- constants::REVIEW_URL;
"on Top.GG.\n\nIf you really want, you can also get Starboard Premium ";
"by [becoming a patron]({})." <- constants::PATREON_URL;
),
))
.field(EmbedFieldBuilder::new(
"Starboard Premium",
concat_format!(
Expand Down