discord-haskell-1.16.1: Write bots for Discord in Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Discord.Internal.Types.Prelude

Description

Provides base types and utility functions needed for modules in Discord.Internal.Types

Synopsis

Documentation

newtype Auth Source #

Authorization token for the Discord API

Constructors

Auth Text 

Instances

Instances details
Read Auth Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Show Auth Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Methods

showsPrec :: Int -> Auth -> ShowS #

show :: Auth -> String #

showList :: [Auth] -> ShowS #

Eq Auth Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Methods

(==) :: Auth -> Auth -> Bool #

(/=) :: Auth -> Auth -> Bool #

Ord Auth Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Methods

compare :: Auth -> Auth -> Ordering #

(<) :: Auth -> Auth -> Bool #

(<=) :: Auth -> Auth -> Bool #

(>) :: Auth -> Auth -> Bool #

(>=) :: Auth -> Auth -> Bool #

max :: Auth -> Auth -> Auth #

min :: Auth -> Auth -> Auth #

authToken :: Auth -> Text Source #

Get the raw token formatted for use with the websocket gateway

newtype Snowflake Source #

A unique integer identifier. Can be used to calculate the creation date of an entity.

Constructors

Snowflake 

Fields

Instances

Instances details
FromJSON Snowflake Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

ToJSON Snowflake Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Read Snowflake Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Show Snowflake Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Eq Snowflake Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Ord Snowflake Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

ToHttpApiData Snowflake Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

snowflakeCreationDate :: Snowflake -> UTCTime Source #

Gets a creation date from a snowflake.

newtype RolePermissions Source #

Instances

Instances details
FromJSON RolePermissions Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

ToJSON RolePermissions Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Bits RolePermissions Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Read RolePermissions Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Show RolePermissions Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Eq RolePermissions Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Ord RolePermissions Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

newtype DiscordId a Source #

Constructors

DiscordId 

Fields

Instances

Instances details
FromJSON (DiscordId a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

ToJSON (DiscordId a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Read (DiscordId a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Show (DiscordId a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Eq (DiscordId a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Methods

(==) :: DiscordId a -> DiscordId a -> Bool #

(/=) :: DiscordId a -> DiscordId a -> Bool #

Ord (DiscordId a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

ToHttpApiData (DiscordId a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

type ChannelId = DiscordId ChannelIdType Source #

type StageId = DiscordId StageIdType Source #

type GuildId = DiscordId GuildIdType Source #

type MessageId = DiscordId MessageIdType Source #

type AttachmentId = DiscordId AttachmentIdType Source #

type EmojiId = DiscordId EmojiIdType Source #

type StickerId = DiscordId StickerIdType Source #

type UserId = DiscordId UserIdType Source #

type RoleId = DiscordId RoleIdType Source #

type IntegrationId = DiscordId IntegrationIdType Source #

type WebhookId = DiscordId WebhookIdType Source #

type ParentId = DiscordId ParentIdType Source #

type ApplicationId = DiscordId ApplicationIdType Source #

type ApplicationCommandId = DiscordId ApplicationCommandIdType Source #

type InteractionId = DiscordId InteractionIdType Source #

type ScheduledEventId = DiscordId ScheduledEventIdType Source #

type ScheduledEventEntityId = DiscordId ScheduledEventEntityIdType Source #

newtype DiscordToken a Source #

Constructors

DiscordToken 

Fields

Instances

Instances details
FromJSON (DiscordToken a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

ToJSON (DiscordToken a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Read (DiscordToken a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Show (DiscordToken a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Eq (DiscordToken a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Ord (DiscordToken a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

ToHttpApiData (DiscordToken a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

type InteractionToken = DiscordToken InteractionIdType Source #

type WebhookToken = DiscordToken WebhookIdType Source #

type Shard = (Int, Int) Source #

epochTime :: UTCTime Source #

Default timestamp

class Data a => InternalDiscordEnum a where Source #

Minimal complete definition

discordTypeStartValue, fromDiscordType

Instances

Instances details
InternalDiscordEnum MessageActivityType Source # 
Instance details

Defined in Discord.Internal.Types.Channel

InternalDiscordEnum MessageFlag Source # 
Instance details

Defined in Discord.Internal.Types.Channel

InternalDiscordEnum MessageType Source # 
Instance details

Defined in Discord.Internal.Types.Channel

InternalDiscordEnum DiscordColor Source # 
Instance details

Defined in Discord.Internal.Types.Color

InternalDiscordEnum StickerFormatType Source # 
Instance details

Defined in Discord.Internal.Types.Emoji

InternalDiscordEnum ActivityType Source # 
Instance details

Defined in Discord.Internal.Types.Guild

InternalDiscordEnum ChannelTypeOption Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

InternalDiscordEnum ScheduledEventPrivacyLevel Source # 
Instance details

Defined in Discord.Internal.Types.ScheduledEvents

InternalDiscordEnum ScheduledEventStatus Source # 
Instance details

Defined in Discord.Internal.Types.ScheduledEvents

InternalDiscordEnum ScheduledEventType Source # 
Instance details

Defined in Discord.Internal.Types.ScheduledEvents

data Base64Image a Source #

Base64Image mime data represents the base64 encoding of an image (as data), together with a tag of its mime type (mime). The constructor is only for Internal use, and its public export is hidden in Discord.Types.

Public creation of this datatype should be done using the relevant smart constructors for Emoji, Sticker, or Avatar.

Constructors

Base64Image 

Instances

Instances details
ToJSON (Base64Image a) Source #

The ToJSON instance for Base64Image creates a string representation of the image's base-64 data, suited for using as JSON values.

The format is: data:%MIME%;base64,%DATA%.

Instance details

Defined in Discord.Internal.Types.Prelude

Read (Base64Image a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Show (Base64Image a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Eq (Base64Image a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Ord (Base64Image a) Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

getMimeType :: ByteString -> Maybe Text Source #

getMimeType bs returns a possible mimetype for the given bytestring, based on the first few magic bytes. It may return any of PNGJPEGGIF or WEBP mimetypes, or Nothing if none are matched.

Reference: https://en.wikipedia.org/wiki/List_of_file_signatures

Although Discord's official documentation does not state WEBP as a supported format, it has been accepted for both emojis and user avatars no problem when tested manually.

Inspired by discord.py's implementation.

(.==) :: ToJSON a => Key -> a -> Maybe Pair Source #

data ChannelTypeOption Source #

The different channel types. Used for application commands and components.

https://discord.com/developers/docs/resources/channel#channel-object-channel-types

Constructors

ChannelTypeOptionGuildText

A text channel in a server.

ChannelTypeOptionDM

A direct message between users.

ChannelTypeOptionGuildVoice

A voice channel in a server.

ChannelTypeOptionGroupDM

A direct message between multiple users.

ChannelTypeOptionGuildCategory

An organizational category that contains up to 50 channels.

ChannelTypeOptionGuildNews

A channel that users can follow and crosspost into their own server.

ChannelTypeOptionGuildStore

A channel in which game developers can sell their game on discord.

ChannelTypeOptionGuildNewsThread

A temporary sub-channel within a guild_news channel.

ChannelTypeOptionGuildPublicThread

A temporary sub-channel within a guild_text channel.

ChannelTypeOptionGuildPrivateThread

A temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission

ChannelTypeOptionGuildStageVoice

A voice channel for hosting events with an audience.

Instances

Instances details
FromJSON ChannelTypeOption Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

ToJSON ChannelTypeOption Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Data ChannelTypeOption Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ChannelTypeOption -> c ChannelTypeOption #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ChannelTypeOption #

toConstr :: ChannelTypeOption -> Constr #

dataTypeOf :: ChannelTypeOption -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ChannelTypeOption) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ChannelTypeOption) #

gmapT :: (forall b. Data b => b -> b) -> ChannelTypeOption -> ChannelTypeOption #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ChannelTypeOption -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ChannelTypeOption -> r #

gmapQ :: (forall d. Data d => d -> u) -> ChannelTypeOption -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ChannelTypeOption -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ChannelTypeOption -> m ChannelTypeOption #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ChannelTypeOption -> m ChannelTypeOption #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ChannelTypeOption -> m ChannelTypeOption #

Read ChannelTypeOption Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Show ChannelTypeOption Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

InternalDiscordEnum ChannelTypeOption Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Eq ChannelTypeOption Source # 
Instance details

Defined in Discord.Internal.Types.Prelude

Ord ChannelTypeOption Source # 
Instance details

Defined in Discord.Internal.Types.Prelude