New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify Position when creating a guild channel #1188
Comments
I haven't looked into this all that much, but I think I might have a workaround I wrote in one of my bots a couple weeks ago. i'm going to take a look at this over Thanksgiving break and see if I can go ahead and fix this one/add that feature. Even if you can't specify position, it is possible to reorder the channels. It might be possible to get this to work with something like that. |
It looks like the discord API has been updated with the changes mentioned above. https://discordapp.com/developers/docs/resources/guild#create-guild-channel now shows position as a parameter we can specify |
So I think I have fixed the issue with not being able to specify position with text and voice channels. Categories is turning out to be a little more of a challenge because its not quite setup the same and I may need to approach that one from a different angle (It doesn't use anything like VoiceChannelProperties or TextChannelProperties like the other ones do). Also, thanks @MikeyMeat, That made this much easier to fix. |
…new channel) (#1196) * Added ability to specify position when creating a channel * Adjusted categories to include guildproperties and allow specifying position when creating channel categories * fixed unimplemented methods (for CreateCategoryChannelAsync) and added appropriate documentation
@foxbot Do we need to close this issue since we merged my fix into the dev branch? |
Resolved via a64ab60 |
* fix: Fixed CommandExecuted firing twice for failed RuntimeResults (discord-net#1192) * Fixed CommandExecuted firing twice for failed RuntimeResults * Changed to just checking the result type * Amendments * Resolve Issue discord-net#1188 (Allow Users to specify position when creating a new channel) (discord-net#1196) * Added ability to specify position when creating a channel * Adjusted categories to include guildproperties and allow specifying position when creating channel categories * fixed unimplemented methods (for CreateCategoryChannelAsync) and added appropriate documentation * feature: add Format.Url, Format.EscapeUrl Format.Url formats a URL into a markdown `[]()` masked URL. Format.EscapeUrl formats a URL into a Discord `<>` escaped URL. * feature: add extensions for bulk reactions this is not api-level bulk reactions (!) * fix: Update ChannelCreateAuditLogData.cs (discord-net#1195) * feature: Implement Dispose for types which have disposable data (discord-net#1171) * Initial set of dispose implementations Not handled yet: - Discord.Net.Websocket/Entities/SocketGuild - Discord.Net.Tests * Refactor DiscordSocketClient init into ctor This way we remove an IDisposableAnalyzer warning for not disposing the client when we set the client variable. * Dispose of clients when disposing sharded client * Finish implementing IDisposable where appropriate I opted to use NoWarn in the Tests project as it wasn't really necessary considering that our tests only run once * Tweak samples after feedback * fix: Added Msg.Content Null Check For Prefixes (discord-net#1200) * Added Msg.Content Null Check * Minor Change * Grouped Params In If Statement * Minor Change * api: [brk] Move Invites-related Methods from IGuildChannel to INestedChannel (discord-net#1172) * Move invites-related methods from IGuildChannel to INestedChannel * Add missing implementation ...because I somehow forgot it the first time around * fix: Solves AudioClient Lockup On Disconnect (discord-net#1203) * Solves Audio Disconnect Lockup * Execute Disconnected Event Before Logger & State * fix: Solves UdpClient "ObjectDisposedException" (discord-net#1202) * Solves "ObjectDisposedException" * Corrected Spelling Error * Fixed Spelling * test: bump dependency versions * fix: Update minimum Bot Token length to 58 char (discord-net#1204) * Update the minimum bot token length to 58 char - Updates the minimum length of a bot token to be 58 characters. An older 58 char bot token was found by Moiph - Makes this value an internal const instead of a magic number * update the TokenUtils tests for 58 char min * fix: Fix after message remaining in MessageUpdated if message author wasn't in the payload (discord-net#1209) * Fix leaving updated message as null when Discords doesn't include a message author in MESSAGE_UPDATE * Name! That! Parameter! * fix: Improve validation of Bot Tokens (discord-net#1206) * improve bot token validation by trying to decode user id from token Try to decode the user id from the supplied bot token as a way of validating the token. If this should fail, indicate that the token is invalid. * Update the tokenutils tests to pass the new validation checks * Add test case for CheckBotTokenValidity method * lint: clean up whitespace * Add check for null or whitespace string, lint whitespace * fix userid conversion * Add hint to user to check that token is not an oauth client secret * Catch exception that can be thrown by GetString * Refactor token conversion logic into it's own testable method * feature: Allow setting custom error messages for preconditions (discord-net#1124) * Rebase and use in all in-box preconditions * Silly git.... * Add configurable 'NotAGuild' message * Respond to feedback * docs: add example of custom error message to sample * feature: add DiscordSocketRestClient (discord-net#1198) * feature: add DiscordSocketRestClient this resolves discord-net#803. Users can access a DiscordSocketRestClient from the new `DiscordSocketClient.Rest` property. DiscordSocketRestClient is a wrapper over DiscordRestClient with certain state-modifying methods, such as Login/Logout disabled, to prevent users from breaking the client state. DiscordSocketRestClient uses the same API client as the DiscordSocketClient, allowing for shared ratelimiting - meaning users can now force HTTP requests without needing to wory about running into 429s. * fix: disallow users from bypassing shadowed login
Over at discord/discord-api-docs#720 there is some brief discussion regarding the ability to specify a new guild channel's position when creating it.
It appears any specified position value would currently be overwritten by the discord endpoint when posting to /guilds/{guild.id}/channels. It also appears that this will be changing as this was not the intended behavior.
It would be nice if we could utilize this functionality when it eventually gets implemented.
Currently it seems like GuildChannelProperties includes a definition for a Position, but CreateGuildChannelParams does not. As a result, the call to CreateTextChannelAsync, CreateVoiceChannelAsync, or CreateCategoryChannelAsync would essentially ignore any specified Position.
The text was updated successfully, but these errors were encountered: