Repository navigation
feat: add /create_channel command - #338
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #338 +/- ##
==========================================
+ Coverage 46.68% 50.42% +3.73%
==========================================
Files 20 22 +2
Lines 1373 1664 +291
==========================================
+ Hits 641 839 +198
- Misses 732 825 +93
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
af3f692 to
45ddbcb
Compare
Creates a text channel in the current (or chosen) category if both the member and the bot could create it there, and links an existing channel with the same name instead of duplicating it.
45ddbcb to
5b5c74d
Compare
|
|
||
| const fn is_separator(c: char) -> bool { | ||
| c.is_whitespace() | ||
| || matches!(c, '-' | '\u{2013}' | '\u{2014}') |
There was a problem hiding this comment.
Can you add a comment on what are these unicode characters here?
There was a problem hiding this comment.
Done, they're en and em dashes turned into -
| c.is_control() | ||
| || matches!( | ||
| c, | ||
| '\'' | '"' | '`' | '\u{2018}' | '\u{2019}' | '\u{201C}' | '\u{201D}' |
There was a problem hiding this comment.
Done, they are different types of quotes to be dropped
|
|
||
| #[derive(Debug, PartialEq, Eq)] | ||
| pub enum Placement { | ||
| Allowed(Option<ChannelId>), |
There was a problem hiding this comment.
We expect this to be Some, as otherwise we return an error anyway (Guild {guild_id} is not cached).
Shouldn't we therefore drop the custom Placement enum and just use a regular Result<ChannelId, String> instead? I don't see much value in this, unless there's any plan to expand this in the future.
There was a problem hiding this comment.
None means the channel should be created outside any category
There was a problem hiding this comment.
Ah, if that's the case, let's keep the Placement enum but instead of the old version, let's have InCategory(ChannelId) and OutsideAnyCategory (or similar) variants then. None is confusing, especially if it's undocumented.
So decide_placement should return Result<Placement, String> then.
0d6f5f2 to
88c83fe
Compare
88c83fe to
6d2fcbb
Compare
Split out of #336, stacked: this → EMA suggestions → update reactions →
#archiwumvotes./create_channel name [category] [topic](Manage Channels) creates a text channel in the current channel's category unless another one is picked, and only if both the member and the bot could create it there, so per-category permissions are respected. Names are normalized the way Discord does it, and an existing channel with the same name in that category is linked instead of duplicated.In chombot-kcc it's behind
FEATURE_CREATE_CHANNEL.🤖 Generated with Claude Code