Skip to content

Releases: tonkku107/slashook

v0.4.0

14 Jun 11:47
85df93a
Compare
Choose a tag to compare
  • Added support for auto-populated Select Menus
    • Added default_values and add_default_value(id, value_type) to SelectMenu
    • Added DefaultValue and DefaultValueType
    • Added resolved to Message
  • Added support for monetization
    • Added entitlements to CommandInput
    • Added premium_required() to CommandResponder
    • Added SKU, SKUType, SKUFlags, Entitlement, EntitlementType, ListEntitlementsOptions, TestEntitlementOptions and EntitlementOwnerType structs/enums
    • Added rest API functions to SKU
      • list_skus(rest, application_id)
    • Added rest API functions to Entitlement
      • list_entitlements(rest, application_id, options)
      • create_test_entitlement(rest, application_id, options)
      • delete_test_entitlement(rest, application_id)
      • consume_entitlement(rest, application_id)
  • Added support for voice messages (thanks @flazepe!)
    • Added set_as_voice_message() to MessageResponse
    • Added duration_secs and waveform to Attachment
    • Added duration_secs, waveform, set_duration(duration_secs) and set_waveform(waveform) to File
    • Added IS_VOICE_MESSAGE to MessageFlags
  • Added support for user-installable apps
    • Added authorizing_integration_owners and context to CommandInput
    • Added integration_types and contexts to Command
    • Removed dm_permissions from Command in favor of contexts
    • Added IntegrationType, IntegrationOwners and InteractionContextType structs/enums
  • Added rest API functions related to pins
    • Added functions to Channel
      • get_pinned_messages(rest)
      • pin_message(rest, message_id)
      • unpin_message(rest, message_id)
    • Added functions to Message
      • pin(rest)
      • unpin(rest)
  • Added support for polls
    • Added poll and set_poll(poll) to MessageResponse
    • Added Poll, PollMedia, PollAnswer, PollLayoutType, PollResults, PollAnswerCount, PollCreateRequest and PollVoters structs/enums
  • Added rest API functions related to threads
    • Added ThreadCreateOptions, ThreadMemberOptions, ThreadListOptions and ThreadListResponse structs
    • Added functions to Channel
      • start_thread(rest, options)
      • join_thread(rest)
      • add_thread_member(rest, user_id)
      • leave_thread(rest)
      • remove_thread_member(rest, user_id)
      • get_thread_member(rest, user_id, options)
      • list_thread_members(rest, options)
      • list_public_archived_threads(rest, options)
      • list_private_archived_threads(rest, options)
      • list_joined_private_archived_threads(rest, options)
    • Added functions to Message
      • start_thread(rest, options)
  • Fixed SelectOption::set_default's argument and return types not being consistent with the rest of the functions
  • Added channel and application_id to CommandInput
  • Changed app_permissions in CommandInput from Option<Permissions> to Permissions
  • Renamed enum variants in AllowedMentionType to upper-case
  • Updated Discord structs
    • Permissions
      • MANAGE_EMOJIS_AND_STICKERS renamed to MANAGE_GUILD_EXPERSSIONS
      • START_EMBEDDED_ACTIVITIES renamed to USE_EMBEDDED_ACTIVITIES
      • Added VIEW_CREATOR_MONETIZATION_ANALYTICS, USE_SOUNDBOARD, USE_EXTERNAL_SOUNDS, SEND_VOICE_MESSAGES, CREATE_GUILD_EXPRESSIONS and CREATE_EVENTS
    • Added message to Channel
    • Added flags to Attachment
      • Added AttachmentFlags bitflags
  • Application
    • Added bot, guild, approximate_guild_count, redirect_uris, interactions_endpoint_url, tags, integration_types, integration_types_config
    • Changed bot_public to Option<bool>
    • Changed bot_require_code_grant to Option<bool>
    • Changed verify_key to Option<String>
    • Added ApplicationIntegrationTypesConfig and ApplicationIntegrationTypesConfigValue structs
  • Message
    • Added interaction_metadata
      • Added MessageInteractionMetadata struct
    • Removed interaction
      • Removed MessageInteraction struct
  • Added APPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE to ApplicationFlags
  • Internal changes
    • bitflags, syn and devise updated to new major versions
    • Changed Into<ComponentType> for SelectMenuType to From<SelectMenuType> for ComponentType
    • Changed description in Command to a wrapper type that allows the string to be optional via macro
    • Moved message related structs to their own file

v0.3.0

08 Apr 15:51
da3a6c0
Compare
Choose a tag to compare
  • 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

v0.2.1

20 Jun 09:00
581251a
Compare
Choose a tag to compare
  • Fixed rocket related build errors by updating to 0.5.0-rc.2
  • Fixed exact dependencies not using the = semver syntax

v0.2.0

18 Feb 17:01
c1044e6
Compare
Choose a tag to compare
  • Switched to API v10
  • Switched to 2021 edition of rust
  • Message.flags is now an Option<MessageFlags>
  • Application.flags is now an Option<ApplicationFlags>
  • SelectMenu.custom_id is now a String
  • MessageResponse.ephemeral has been replaced with flags
    • set_suppress_embeds(suppress) was also added
  • Followup methods in CommandResponder now have RestError as error type
  • Added support for autocomplete interactions
    • Added values and focused to CommandInput
    • Added autocomplete(results) to CommandResponder
  • Added support for attachment option type and improved attachment support
    • Added attachments and keep_attachment(attachment_id) to MessageResponse
    • Added attachments to InteractionDataResolved
    • Added Attachment, is_attachment() and as_attachment() to OptionValue
    • Added description and set_description(description) to File
    • Added support for sending files within the initial interaction response
  • Added support for modal interactions and text input components
    • Added MODAL_SUBMIT to InteractionTypes
    • Added Modal struct in commands module
    • Added open_modal(modal) to CommandResponder
    • Added TEXT_INPUT to ComponentType
    • Added TextInput and add_text_input(text_input) to Component
  • Added interaction_type, command_type, component_type, locale and guild_locale to CommandInput
  • Added interaction type checking methods to CommandInput
    • is_command()
    • is_chat_input()
    • is_user_context()
    • is_message_context()
    • is_component()
    • is_button()
    • is_select_menu()
    • is_autocomplete()
    • is_modal_submit()
  • Updated Discord object structs
    • Added ephemeral and description to Attachment
    • Added create_timestamp to ThreadMetadata
    • Renamed APPLICATION_COMMAND to CHAT_INPUT_COMMAND and added CONTEXT_MENU_COMMAND in MessageType
    • Added member to MessageActivity
    • Added avatar and communication_disabled_until to GuildMember
    • Added icon and unicode_emoji to Role
    • Permissions:
      • Added MANAGE_EVENTS, SEND_MESSAGES_IN_THREADS, START_EMBEDDED_ACTIVITIES and MODERATE_MEMBERS
      • Renamed USE_PUBLIC_THREADS and USE_PRIVATE_THREADS to CREATE_PUBLIC_THREADS and CREATE_PRIVATE_THREADS respectively
    • UserFlags:
      • DISCORD_EMPLOYEE -> STAFF
      • PARTNERED_SERVER_OWNER -> PARTNER
      • HYPESQUAD_EVENTS -> HYPESQUAD
      • HOUSE_BRAVERY -> HYPESQUAD_ONLINE_HOUSE_1
      • HOUSE_BRILLIANCE -> HYPESQUAD_ONLINE_HOUSE_2
      • HOUSE_BALANCE -> HYPESQUAD_ONLINE_HOUSE_3
      • EARLY_SUPPORTER -> PREMIUM_EARLY_SUPPORTER
      • TEAM_USER -> TEAM_PSEUDO_USER
      • EARLY_VERIFIED_BOT_DEVELOPER -> VERIFIED_DEVELOPER
      • Added CERTIFIED_MODERATOR and BOT_HTTP_INTERACTIONS
  • Started work on adding REST API methods to structs
    • Added rest to CommandInput
    • Added bot_token to Config
    • Added fetch(rest, channel_id, message_id), fetch_many(rest, channel_id, options), create(rest, channel_id, message), edit(rest, message), delete(rest) and crosspost(rest) to Message
  • Fixed some *_type fields not being renamed when (de)serializing
  • Added skipping serialization on embeds, components, attachments and allowed_mentions if None in MessageResponse
  • Added documentation wherever it was missing

v0.1.0

04 Oct 11:59
4e807ef
Compare
Choose a tag to compare

First release