Skip to content

Commit

Permalink
Version 0.0.7 released
Browse files Browse the repository at this point in the history
  • Loading branch information
MoskalykA authored Jun 7, 2023
2 parents d94be29 + b43bd40 commit 11d918f
Show file tree
Hide file tree
Showing 24 changed files with 79 additions and 95 deletions.
22 changes: 1 addition & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,7 @@ async fn main() {
client.set_heartbeat_ack(true);

// Send all the permissions you need from your bot to discord
client.add_intents(vec![
Intent::Guilds,
Intent::GuildMembers,
Intent::GuildModeration,
Intent::GuildEmojisAndStickers,
Intent::GuildIntegrations,
Intent::GuildWebhooks,
Intent::GuildInvites,
Intent::GuildVoiceStates,
Intent::GuildPresences,
Intent::GuildMessages,
Intent::GuildMessageReactions,
Intent::GuildMessageTyping,
Intent::DirectMessages,
Intent::DirectMessageReactions,
Intent::DirectMessageTyping,
Intent::MessageContent,
Intent::GuildScheduledEvents,
Intent::AutoModerationConfiguration,
Intent::AutoModerationExecution,
]);
client.all_intents();

// The ready event will be launched once your bot is connected
client.on_ready(|ready| {
Expand Down
2 changes: 1 addition & 1 deletion adiscord-intents/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "adiscord-intents"
version = "0.0.3"
version = "0.0.4"
authors = ["MoskalykA <[email protected]>"]
edition = "2021"
description = "Calculate the number of intents from a list of enums"
Expand Down
1 change: 1 addition & 0 deletions adiscord-intents/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[repr(u32)]
pub enum Intent {
/// Exhaustive list of events included:
///
Expand Down
4 changes: 2 additions & 2 deletions adiscord-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ license = "MIT"
[dependencies]
dotenv_codegen = "0.15.0"
tokio = { version = "1", features = ["rt-multi-thread"] }
adiscord = { version = "0.0.7", features = ["gateway"] }
adiscord-intents = "0.0.3"
adiscord = { version = "0.0.8", features = ["gateway"] }
adiscord-intents = "0.0.4"
7 changes: 4 additions & 3 deletions adiscord-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "adiscord-types"
version = "0.0.3"
version = "0.0.4"
authors = ["MoskalykA <[email protected]>"]
edition = "2021"
description = "The large list of Discord API types and Gateway types"
Expand All @@ -10,8 +10,9 @@ repository = "https://github.com/MoskalykA/adiscord"
license = "MIT"

[dependencies]
serde = { version = "1.0.157", features = ["derive"] }
serde_json = { version = "1.0.95" }
serde = { version = "1.0.163", features = ["derive"] }
serde_json = { version = "1.0.96" }
serde_repr = "0.1.12"

[features]
gateway = []
Expand Down
3 changes: 2 additions & 1 deletion adiscord-types/src/api/application.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use super::{team::Team, user::User};
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

#[repr(u32)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum Flags {
None,

Expand Down
3 changes: 2 additions & 1 deletion adiscord-types/src/api/audit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use serde::{Deserialize, Serialize};
use serde_json::Value;
use serde_repr::{Deserialize_repr, Serialize_repr};

#[derive(Deserialize, Serialize, Debug)]
pub struct Change {
Expand All @@ -15,7 +16,7 @@ pub struct Change {

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum Event {
/// Server settings were updated
GUILD_UPDATE = 1,
Expand Down
13 changes: 9 additions & 4 deletions adiscord-types/src/api/auto_moderation.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
use serde::{Deserialize, Serialize};
use serde_json::Value;
use serde_repr::{Deserialize_repr, Serialize_repr};

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum EventType {
/// when a member sends or edits a message in the guild
MESSAGE_SEND = 1,
}

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum TriggerType {
/// check if content contains words from a user defined list of keywords
KEYWORD = 1,
Expand All @@ -24,8 +27,9 @@ pub enum TriggerType {
MENTION_SPAM,
}

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum KeywordPreset {
/// words that may be considered forms of swearing or cursing
PROFANITY = 1,
Expand Down Expand Up @@ -58,8 +62,9 @@ pub struct TriggerMetadata {
pub mention_raid_protection_enabled: Option<bool>,
}

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum ActionType {
/// blocks a member's message and prevents it from being posted. A custom explanation can be specified and shown to members whenever their message is blocked.
BLOCK_MESSAGE = 1,
Expand Down
11 changes: 6 additions & 5 deletions adiscord-types/src/api/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use super::{
user::User,
};
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

#[derive(Deserialize, Serialize, Debug)]
pub struct Attachment {
Expand Down Expand Up @@ -41,7 +42,7 @@ pub struct Attachment {

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum Flags {
None,

Expand All @@ -54,7 +55,7 @@ pub enum Flags {

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum ForumLayout {
/// No default has been set for forum channel
NOT_SET,
Expand Down Expand Up @@ -98,7 +99,7 @@ pub struct Overwrite {

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum SortOrder {
/// Sort forum posts by activity
LATEST_ACTIVITY,
Expand All @@ -109,7 +110,7 @@ pub enum SortOrder {

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum ChannelType {
/// atext channel within a server
GUILD_TEXT,
Expand Down Expand Up @@ -149,7 +150,7 @@ pub enum ChannelType {
}

#[repr(u8)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum VideoQuality {
/// Discord chooses the quality for optimal performance
AUTO = 1,
Expand Down
17 changes: 9 additions & 8 deletions adiscord-types/src/api/guild.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use super::{emoji::Emoji, feature::Feature, role::Role, sticker::Sticker, user::User};
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum MemberFlags {
None,

Expand Down Expand Up @@ -85,7 +86,7 @@ pub struct WelcomeScreen {

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum DefaultMessageNotifications {
/// members will receive notifications for all messages by default
ALL_MESSAGES,
Expand All @@ -96,7 +97,7 @@ pub enum DefaultMessageNotifications {

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum ExplicitContentFilter {
/// media content will not be scanned
DISABLED,
Expand All @@ -109,7 +110,7 @@ pub enum ExplicitContentFilter {
}

#[repr(u8)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum MFALevel {
/// guild has no MFA/2FA requirement for moderation actions
None,
Expand All @@ -119,7 +120,7 @@ pub enum MFALevel {
}

#[repr(u8)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum NSFWLevel {
Default,
Explicit,
Expand All @@ -128,7 +129,7 @@ pub enum NSFWLevel {
}

#[repr(u8)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum PremiumTier {
/// guild has not unlocked any Server Boost perks
None,
Expand Down Expand Up @@ -180,7 +181,7 @@ pub struct Preview {
}

#[repr(u8)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum SystemChannelFlags {
None,

Expand All @@ -205,7 +206,7 @@ pub enum SystemChannelFlags {

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum VerificationLevel {
/// unrestricted
NONE,
Expand Down
4 changes: 3 additions & 1 deletion adiscord-types/src/api/integration.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use super::{application::Application, user::User};
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum ExpireBehavior {
RemoveRole = 0,
Kick,
Expand Down
11 changes: 6 additions & 5 deletions adiscord-types/src/api/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ use super::{
};
use crate::api::{application::Application, role::Role, user::User};
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum ActivityType {
JOIN = 1,
SPECTATE,
Expand All @@ -28,7 +29,7 @@ pub struct Activity {

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum InteractionType {
PING = 1,
APPLICATION_COMMAND,
Expand Down Expand Up @@ -56,7 +57,7 @@ pub struct Interaction {
}

#[repr(u8)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum Component {
/// Container for other components
ActionRow = 1,
Expand Down Expand Up @@ -85,7 +86,7 @@ pub enum Component {

#[repr(u16)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum Flags {
None,

Expand Down Expand Up @@ -152,7 +153,7 @@ pub struct RoleSubscriptionData {

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum Type {
DEFAULT,
RECIPIENT_ADD,
Expand Down
3 changes: 2 additions & 1 deletion adiscord-types/src/api/stage.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum PrivacyLevel {
/// The Stage instance is visible publicly. (deprecated)
PUBLIC = 1,
Expand Down
5 changes: 3 additions & 2 deletions adiscord-types/src/api/sticker.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use super::user::User;
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

#[repr(u8)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum FormatType {
PNG = 1,
APNG,
Expand All @@ -23,7 +24,7 @@ pub struct Item {
}

#[repr(u8)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum Type {
/// an official sticker in a pack, part of Nitro or in a removed purchasable pack
Standard = 1,
Expand Down
3 changes: 2 additions & 1 deletion adiscord-types/src/api/team.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use super::user::User;
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum MemberState {
INVITED = 1,
ACCEPTED,
Expand Down
8 changes: 6 additions & 2 deletions adiscord-types/src/api/user.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

#[repr(u32)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum Flags {
Unknow,

/// Discord Employee
STAFF = 1 << 0,

Expand Down Expand Up @@ -50,8 +53,9 @@ pub enum Flags {
ACTIVE_DEVELOPER = 1 << 22,
}

#[repr(u8)]
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
#[derive(Deserialize_repr, Serialize_repr, Debug)]
pub enum PreniumType {
NONE,
NITRO_CLASSIC,
Expand Down
Loading

0 comments on commit 11d918f

Please sign in to comment.