Skip to content

v0.3.0

Compare
Choose a tag to compare
@tonkku107 tonkku107 released this 08 Apr 15:51
· 18 commits to main since this release
da3a6c0
  • Added a command sync functionality
    • The command macro now has a new format that lets you specify the command's options and more
    • Added client_id and client_secret to Config
    • Added sync_commands() and sync_guild_commands(guild_id) to Client
    • Renamed sub_command to subcommand and sub_command_group to subcommand_group in CommandInput
    • Added TryFrom<u8> traits to ChannelType, ApplicationCommandType and InteractionOptionType
    • Added From<u64> trait to Permissions
    • Added name_localizations to ApplicationCommandOptionChoice
    • Added with_client_credentials(client_id, client_secret, scopes) to the rest handler
    • Added ApplicationCommand and ApplicationCommandOption structs
      • ApplicationCommand has bulk_overwrite_global_commands(rest, application_id, commands) and bulk_overwrite_guild_commands(rest, application_id, guild_id, commands) rest api functions
    • Made InteractionOptionType visible in documentation
  • Added support for new select menu types
    • Added resolved_values, is_string_select(), is_user_select(), is_role_select(), is_mentionable_select() and is_channel_select() to CommandInput
    • Removed is_select_menu() from CommandInput
    • Added USER_SELECT, ROLE_SELECT, MENTIONABLE_SELECT and CHANNEL_SELECT to ComponentType
    • Renamed SELECT_MENU to STRING_SELECT in ComponentType
    • options in SelectMenu is now an Option<Vec<SelectOption>>
    • Added channel_types, get_type() and add_channel_type(channel_type) to SelectMenu
    • Added SelectMenuType
  • Added rest API functions related to reactions
    • Added ReactionFetchOptions struct
    • Added functions to Message
      • create_reaction(rest, emoji)
      • delete_reaction(rest, emoji)
      • delete_user_reaction(rest, emoji, user_id)
      • get_reactions(rest, emoji, options)
      • delete_all_reactions(rest)
      • delete_all_reactions_for_emoji(rest, emoji)
  • Added rest API functions related to channels
    • Added ChannelModifyOptions, FollowedChannel and CreateInviteOptions structs
    • Added functions to Channel
      • fetch(rest, channel_id)
      • modify(rest, options)
      • delete(rest)
      • fetch_messages(rest, options)
      • fetch_message(rest, message_id)
      • create_message(rest, message)
      • bulk_delete_messages(rest, messages)
      • edit_channel_permission(rest, overwrite)
      • delete_channel_permission(rest, overwrite_id)
      • get_invites(rest)
      • create_invite(rest, options)
      • follow(rest, target_channel_id)
      • trigger_typing(rest)
  • The send_message, update_message, defer, defer_update, autocomplete and open_modal functions in CommandResponder are now async
    • send_message and update_message will now call send_followup_message and edit_original_message respectively if the interaction has already been responded to
    • The rest will return an InteractionResponseError if the interaction has already been responded to
  • Added clear_embeds and clear_attachments to MessageResponse
    • Added an example to the documentation for keep_attachment
  • Added app_permissions to CommandInput
  • joined_at and premium_since in GuildMember now use DateTime
  • color in Role now uses the Color util type
  • Added more From traits to MessageResponse
    • From<File>
    • From<Vec<File>>
    • From<Vec<Embed>>
  • Components is now a tuple struct
  • Added user-agent headers to requests and responses
  • Added put(path, data) to the rest handler
  • Message content will no longer be serialized (to null) if None
  • Updated Discord object structs
    • Renamed PermissionOverwrites struct to PermissionOverwrite
    • Added managed, flags, total_message_sent, available_tags, default_reaction_emoji, default_thread_rate_limit_per_user, default_sort_order and default_forum_layout to Channel
      • Added ChannelFlags bitflags
      • Added ForumTag and DefaultReaction structs
      • Added SortOrderType and ForumLayoutType enums
    • ChannelType:
      • GUILD_NEWS -> GUILD_ANNOUNCEMENT
      • Removed GUILD_STORE
      • GUILD_NEWS_THREAD -> ANNOUNCEMENT_THREAD
      • Added GUILD_DIRECTORY and GUILD_FORUM
    • Added member to ThreadMetadata
    • Added Sticker and StickerType structs
      • Moved StickerItem and StickerFormatType from channels to stickers
    • Added position and role_subscription_data to Message
      • Added RoleSubscriptionData struct
    • MessageType:
      • GUILD_MEMBER_JOIN -> USER_JOIN
      • USER_PREMIUM_GUILD_SUBSCRIPTION -> GUILD_BOOST
      • USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1 -> GUILD_BOOST_TIER_1
      • USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2 -> GUILD_BOOST_TIER_2
      • USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3 -> GUILD_BOOST_TIER_3
      • Added AUTO_MODERATION_ACTION, ROLE_SUBSCRIPTION_PURCHASE, INTERACTION_PREMIUM_UPSELL, STAGE_START , STAGE_END, STAGE_SPEAKER, STAGE_TOPIC and GUILD_APPLICATION_PREMIUM_SUBSCRIPTION
    • Added FAILED_TO_MENTION_SOME_ROLES_IN_THREAD and SUPPRESS_NOTIFICATIONS to MessageFlags
    • Added Guild struct
      • Added VerificationLevel, MessageNotificationsLevel, ExplicitContentFilterLevel, MFALevel, PremiumTier, NSFWLevel, PrivacyLevel, EventStatus, EntityType enums
      • Added WelcomeScreen, WelcomeScreenChannel, GuildScheduledEvent, EntityMetadata structs
      • Added SystemChannelFlags bitfield
    • Added Invite struct
      • Added TargetType enum
    • Added install_params, custom_install_url and role_connections_verification_url to Application
      • Added InstallParams struct
    • Added APPLICATION_COMMAND_BADGE to ApplicationFlags
    • Added flags to GuildMember
      • Added GuildMemberFlags bitflags
    • Added subscription_listing_id, available_for_purchase and guild_connections to RoleTags
    • Added ACTIVE_DEVELOPER to UserFlags
    • Added NITRO_BASIC to PremiumType
    • Updated documentation
  • Internal changes
    • Rest client is reused instead of recreated with each request
    • Moved defer message flag processing
    • Removed a workaround for multipart handling
    • Improved error handling
    • Rest handler can now return () from generics
    • Added to_url_format() to Emoji
    • Replaced format_response in CommandHandler with a From trait
    • split macro converter functionality to a separate file
    • split command handler functionality to a separate file