Skip to content

Commit

Permalink
rename "news" channel to announcement channel
Browse files Browse the repository at this point in the history
  • Loading branch information
Commandserver committed Aug 29, 2022
1 parent 8173d8f commit bab3f09
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
18 changes: 9 additions & 9 deletions include/dpp/channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ enum channel_type : uint8_t {
*/
GROUP_DM = 3,
CHANNEL_CATEGORY = 4, //!< an organizational category that contains up to 50 channels
CHANNEL_NEWS = 5, //!< a channel that users can follow and crosspost into their own server
CHANNEL_ANNOUNCEMENT = 5, //!< a channel that users can follow and crosspost into their own server
/**
* @brief a channel in which game developers can sell their game on Discord
* @deprecated store channels are deprecated by Discord
*/
CHANNEL_STORE = 6,
CHANNEL_NEWS_THREAD = 10, //!< a temporary sub-channel within a GUILD_NEWS channel
CHANNEL_ANNOUNCEMENT_THREAD = 10, //!< a temporary sub-channel within a GUILD_ANNOUNCEMENT channel
CHANNEL_PUBLIC_THREAD = 11, //!< a temporary sub-channel within a GUILD_TEXT channel
CHANNEL_PRIVATE_THREAD = 12, //!< a temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission
CHANNEL_STAGE = 13, //!< a "stage" channel, like a voice channel with one authorised speaker
Expand Down Expand Up @@ -277,23 +277,23 @@ class DPP_EXPORT channel : public managed, public json_interface<channel> {
/**
* @brief Set flags for this channel object
*
* @param flags Flag bitmask to set
* @param flags Flag bitmask to set from dpp::channel_flags
* @return Reference to self, so these method calls may be chained
*/
channel& set_flags(const uint16_t flags);

/**
* @brief Add (bitwise OR) a flag to this channel object
*
* @param flag Flag bit to set
* @param flag Flag bit to add from dpp::channel_flags
* @return Reference to self, so these method calls may be chained
*/
channel& add_flag(const channel_flags flag);

/**
* @brief Remove (bitwise NOT AND) a flag from this channel object
*
* @param flag Flag bit to set
* @param flag Flag bit to remove from dpp::channel_flags
* @return Reference to self, so these method calls may be chained
*/
channel& remove_flag(const channel_flags flag);
Expand Down Expand Up @@ -496,9 +496,9 @@ class DPP_EXPORT channel : public managed, public json_interface<channel> {
bool is_forum() const;

/**
* @brief Returns true if the channel is a news channel
* @brief Returns true if the channel is an announcement channel
*
* @return true if news channel
* @return true if announcement channel
*/
bool is_news_channel() const;

Expand Down Expand Up @@ -566,9 +566,9 @@ class DPP_EXPORT thread : public channel {
thread();

/**
* @brief Returns true if the channel is a news thread
* @brief Returns true if the thread is within an announcement channel
*
* @return true if news thread
* @return true if announcement thread
*/
bool is_news_thread() const;

Expand Down
4 changes: 2 additions & 2 deletions include/dpp/cluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -2067,7 +2067,7 @@ class DPP_EXPORT cluster {
void channel_delete_permission(const class channel &c, snowflake overwrite_id, command_completion_event_t callback = utility::log_error());

/**
* @brief Follow a news channel
* @brief Follow an announcement (news) channel
* @see https://discord.com/developers/docs/resources/channel#follow-news-channel
* @param c Channel id to follow
* @param target_channel_id Channel to subscribe the channel to
Expand Down Expand Up @@ -3044,7 +3044,7 @@ class DPP_EXPORT cluster {
* @param thread_name Name of the thread
* @param channel_id Channel in which thread to create
* @param auto_archive_duration Duration after which thread auto-archives. Can be set to - 60, 1440 (for boosted guilds can also be: 4320, 10080)
* @param thread_type Type of thread - GUILD_PUBLIC_THREAD, GUILD_NEWS_THREAD, GUILD_PRIVATE_THREAD
* @param thread_type Type of thread - CHANNEL_PUBLIC_THREAD, CHANNEL_ANNOUNCEMENT_THREAD, CHANNEL_PRIVATE_THREAD
* @param invitable whether non-moderators can add other non-moderators to a thread; only available when creating a private thread
* @param rate_limit_per_user amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission manage_messages, manage_thread, or manage_channel, are unaffected
* @param callback Function to call when the API call completes.
Expand Down
6 changes: 3 additions & 3 deletions include/dpp/guild.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ enum guild_flags : uint32_t {
* @deprecated Removed by Discord
*/
g_commerce = 0b00000000000000000000001000000000,
/** Guild has news features enabled */
/** Guild has access to create announcement channels */
g_news = 0b00000000000000000000010000000000,
/** Guild is discoverable in discovery */
g_discoverable = 0b00000000000000000000100000000000,
Expand Down Expand Up @@ -725,8 +725,8 @@ class DPP_EXPORT guild : public managed, public json_interface<guild> {
bool has_commerce() const;

/**
* @brief Guild has access to create news channels
* @return bool has news channels features enabled
* @brief Guild has access to create announcement channels
* @return bool has announcement channels features enabled
*/
bool has_news() const;

Expand Down
8 changes: 4 additions & 4 deletions include/dpp/integration.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ class DPP_EXPORT integration : public managed, public json_interface<integration
snowflake role_id;
/** User id */
snowflake user_id;
/** Expiry grace period */
/** The grace period (in days) before expiring subscribers */
uint32_t expire_grace_period;
/** Sync time */
time_t synced_at;
/** Subscriber count */
uint32_t subscriber_count;
/* Account id */
/** Account id */
std::string account_id;
/* Account name */
/** Account name */
std::string account_name;
/* Integration application */
/** The bot/OAuth2 application for discord integrations */
integration_app app;

/** Default constructor */
Expand Down
4 changes: 2 additions & 2 deletions include/dpp/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ struct DPP_EXPORT message : public managed {
bool is_crossposted() const;

/**
* @brief Returns true if posted from other servers news channel via webhook
* @brief Returns true if posted from other servers announcement channel via webhook
*
* @return true if posted from other server
*/
Expand Down Expand Up @@ -1376,7 +1376,7 @@ struct DPP_EXPORT message : public managed {
/**
* @brief Set the flags
*
* @param f flags to set
* @param f flags to set from dpp::message_flags
* @return message& reference to self
*/
message& set_flags(uint8_t f);
Expand Down
2 changes: 1 addition & 1 deletion include/dpp/role.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class DPP_EXPORT role : public managed, public json_interface<role> {
/**
* @brief Set the flags
*
* @param f Flags to set
* @param f Flags to set from dpp::role_flags
* @return role& reference to self
*/
role& set_flags(uint8_t f);
Expand Down
4 changes: 2 additions & 2 deletions src/dpp/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ bool channel::is_stage_channel() const {
}

bool channel::is_news_channel() const {
return (flags & CHANNEL_TYPE_MASK) == CHANNEL_NEWS;
return (flags & CHANNEL_TYPE_MASK) == CHANNEL_ANNOUNCEMENT;
}

bool channel::is_store_channel() const {
Expand All @@ -216,7 +216,7 @@ bool channel::is_pinned_thread() const {
}

bool thread::is_news_thread() const {
return (flags & CHANNEL_TYPE_MASK) == CHANNEL_NEWS_THREAD;
return (flags & CHANNEL_TYPE_MASK) == CHANNEL_ANNOUNCEMENT_THREAD;
}

bool thread::is_public_thread() const {
Expand Down

0 comments on commit bab3f09

Please sign in to comment.