calamity-0.8.0.0: A library for writing discord bots in haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Calamity.Types.Snowflake

Description

The snowflake type

Synopsis

Documentation

newtype Snowflake (t :: Type) Source #

Constructors

Snowflake 

Instances

Instances details
HasID a (Snowflake a) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Methods

getID :: Snowflake a -> Snowflake a Source #

Upgradeable Channel (Snowflake Channel) Source # 
Instance details

Defined in Calamity.Types.Upgradeable

Methods

upgrade :: forall (r :: EffectRow). BotC r => Snowflake Channel -> Sem r (Maybe Channel) Source #

Upgradeable DMChannel (Snowflake DMChannel) Source # 
Instance details

Defined in Calamity.Types.Upgradeable

Methods

upgrade :: forall (r :: EffectRow). BotC r => Snowflake DMChannel -> Sem r (Maybe DMChannel) Source #

Upgradeable GroupChannel (Snowflake GroupChannel) Source # 
Instance details

Defined in Calamity.Types.Upgradeable

Methods

upgrade :: forall (r :: EffectRow). BotC r => Snowflake GroupChannel -> Sem r (Maybe GroupChannel) Source #

Upgradeable GuildChannel (Snowflake GuildChannel) Source # 
Instance details

Defined in Calamity.Types.Upgradeable

Methods

upgrade :: forall (r :: EffectRow). BotC r => Snowflake GuildChannel -> Sem r (Maybe GuildChannel) Source #

Upgradeable Category (Snowflake Category) Source # 
Instance details

Defined in Calamity.Types.Upgradeable

Methods

upgrade :: forall (r :: EffectRow). BotC r => Snowflake Category -> Sem r (Maybe Category) Source #

Upgradeable TextChannel (Snowflake TextChannel) Source # 
Instance details

Defined in Calamity.Types.Upgradeable

Methods

upgrade :: forall (r :: EffectRow). BotC r => Snowflake TextChannel -> Sem r (Maybe TextChannel) Source #

Upgradeable VoiceChannel (Snowflake VoiceChannel) Source # 
Instance details

Defined in Calamity.Types.Upgradeable

Methods

upgrade :: forall (r :: EffectRow). BotC r => Snowflake VoiceChannel -> Sem r (Maybe VoiceChannel) Source #

Upgradeable Guild (Snowflake Guild) Source # 
Instance details

Defined in Calamity.Types.Upgradeable

Methods

upgrade :: forall (r :: EffectRow). BotC r => Snowflake Guild -> Sem r (Maybe Guild) Source #

Upgradeable User (Snowflake User) Source # 
Instance details

Defined in Calamity.Types.Upgradeable

Methods

upgrade :: forall (r :: EffectRow). BotC r => Snowflake User -> Sem r (Maybe User) Source #

Upgradeable Emoji (Snowflake Guild, Snowflake Emoji) Source # 
Instance details

Defined in Calamity.Types.Upgradeable

Methods

upgrade :: forall (r :: EffectRow). BotC r => (Snowflake Guild, Snowflake Emoji) -> Sem r (Maybe Emoji) Source #

Upgradeable Member (Snowflake Guild, Snowflake Member) Source # 
Instance details

Defined in Calamity.Types.Upgradeable

Methods

upgrade :: forall (r :: EffectRow). BotC r => (Snowflake Guild, Snowflake Member) -> Sem r (Maybe Member) Source #

Upgradeable Role (Snowflake Guild, Snowflake Role) Source # 
Instance details

Defined in Calamity.Types.Upgradeable

Methods

upgrade :: forall (r :: EffectRow). BotC r => (Snowflake Guild, Snowflake Role) -> Sem r (Maybe Role) Source #

FromJSON (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

FromJSONKey (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

ToJSON (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

ToJSONKey (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Data t => Data (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Methods

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

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

toConstr :: Snowflake t -> Constr #

dataTypeOf :: Snowflake t -> DataType #

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

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

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

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

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

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

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

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

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

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

Show (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Tellable (Snowflake Channel) Source # 
Instance details

Defined in Calamity.Types.Tellable

Tellable (Snowflake DMChannel) Source # 
Instance details

Defined in Calamity.Types.Tellable

Tellable (Snowflake TextChannel) Source # 
Instance details

Defined in Calamity.Types.Tellable

Tellable (Snowflake Member) Source # 
Instance details

Defined in Calamity.Types.Tellable

Tellable (Snowflake User) Source # 
Instance details

Defined in Calamity.Types.Tellable

Methods

getChannel :: forall (r :: EffectRow). (BotC r, Member (Error RestError) r) => Snowflake User -> Sem r (Snowflake Channel) Source #

Mentionable (Snowflake Channel) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake DMChannel) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake GuildChannel) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake Category) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake TextChannel) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake VoiceChannel) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake Member) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake Role) Source # 
Instance details

Defined in Calamity.Utils.Message

Mentionable (Snowflake User) Source # 
Instance details

Defined in Calamity.Utils.Message

PermissionsIn' (Snowflake GuildChannel) Source #

A Member's Permissions in a channel are their roles and overwrites

This will fetch the guild and channel from the cache or http as needed

Instance details

Defined in Calamity.Utils.Permissions

Methods

permissionsIn' :: forall (r :: EffectRow) u. (BotC r, HasID User u) => Snowflake GuildChannel -> u -> Sem r Permissions Source #

PermissionsIn' (Snowflake Guild) Source #

A Member's Permissions in a guild are just their roles

This will fetch the guild from the cache or http as needed

Instance details

Defined in Calamity.Utils.Permissions

Methods

permissionsIn' :: forall (r :: EffectRow) u. (BotC r, HasID User u) => Snowflake Guild -> u -> Sem r Permissions Source #

Eq (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Methods

(==) :: Snowflake t -> Snowflake t -> Bool #

(/=) :: Snowflake t -> Snowflake t -> Bool #

Ord (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Hashable (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Methods

hashWithSalt :: Int -> Snowflake t -> Int #

hash :: Snowflake t -> Int #

ToHttpApiData (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

TextShow (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Unboxable (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Associated Types

type Rep (Snowflake t) #

type CoercibleRep (Snowflake t)

type IsTrivial (Snowflake t) :: Bool

ParameterParser (Snowflake Channel) c r

Accepts both plain IDs and mentions

Instance details

Defined in Calamity.Commands.CalamityParsers

Associated Types

type ParserResult (Snowflake Channel)

Methods

parameterInfo :: ParameterInfo

parameterDescription :: Text

parse :: Sem (ParserEffs c r) (ParserResult (Snowflake Channel))

ParameterParser (Snowflake Emoji) c r

Accepts both plain IDs and uses of emoji

Instance details

Defined in Calamity.Commands.CalamityParsers

Associated Types

type ParserResult (Snowflake Emoji)

Methods

parameterInfo :: ParameterInfo

parameterDescription :: Text

parse :: Sem (ParserEffs c r) (ParserResult (Snowflake Emoji))

ParameterParser (Snowflake Member) c r

Accepts both plain IDs and mentions

Instance details

Defined in Calamity.Commands.CalamityParsers

Associated Types

type ParserResult (Snowflake Member)

Methods

parameterInfo :: ParameterInfo

parameterDescription :: Text

parse :: Sem (ParserEffs c r) (ParserResult (Snowflake Member))

ParameterParser (Snowflake Role) c r

Accepts both plain IDs and mentions

Instance details

Defined in Calamity.Commands.CalamityParsers

Associated Types

type ParserResult (Snowflake Role)

Methods

parameterInfo :: ParameterInfo

parameterDescription :: Text

parse :: Sem (ParserEffs c r) (ParserResult (Snowflake Role))

ParameterParser (Snowflake User) c r

Accepts both plain IDs and mentions

Instance details

Defined in Calamity.Commands.CalamityParsers

Associated Types

type ParserResult (Snowflake User)

Methods

parameterInfo :: ParameterInfo

parameterDescription :: Text

parse :: Sem (ParserEffs c r) (ParserResult (Snowflake User))

Typeable (Snowflake a) => ParameterParser (Snowflake a) c r 
Instance details

Defined in Calamity.Commands.CalamityParsers

Associated Types

type ParserResult (Snowflake a)

Methods

parameterInfo :: ParameterInfo

parameterDescription :: Text

parse :: Sem (ParserEffs c r) (ParserResult (Snowflake a))

type ParserResult (Snowflake Channel) 
Instance details

Defined in Calamity.Commands.CalamityParsers

type ParserResult (Snowflake Channel) = Snowflake Channel
type ParserResult (Snowflake Emoji) 
Instance details

Defined in Calamity.Commands.CalamityParsers

type ParserResult (Snowflake Emoji) = Snowflake Emoji
type ParserResult (Snowflake Member) 
Instance details

Defined in Calamity.Commands.CalamityParsers

type ParserResult (Snowflake Member) = Snowflake Member
type ParserResult (Snowflake Role) 
Instance details

Defined in Calamity.Commands.CalamityParsers

type ParserResult (Snowflake Role) = Snowflake Role
type ParserResult (Snowflake User) 
Instance details

Defined in Calamity.Commands.CalamityParsers

type ParserResult (Snowflake User) = Snowflake User
type ParserResult (Snowflake a) 
Instance details

Defined in Calamity.Commands.CalamityParsers

type ParserResult (Snowflake a) = Snowflake a
type CoercibleRep (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

type CoercibleRep (Snowflake t) = CoercibleRep Word64
type IsTrivial (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

type IsTrivial (Snowflake t) = IsTrivial Word64
type Rep (Snowflake t) Source # 
Instance details

Defined in Calamity.Types.Snowflake

type Rep (Snowflake t) = Rep Word64

class HasID b a where Source #

A typeclass for types that contain snowflakes of type b

Methods

getID :: a -> Snowflake b Source #

Retrieve the ID from the type

Instances

Instances details
HasID Channel FullContext Source # 
Instance details

Defined in Calamity.Commands.Context

HasID Channel LightContext Source # 
Instance details

Defined in Calamity.Commands.Context

HasID Channel ReactionEvtData Source # 
Instance details

Defined in Calamity.Gateway.DispatchEvents

HasID Channel Channel Source # 
Instance details

Defined in Calamity.Types.Model.Channel

HasID Channel DMChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.DM

HasID Channel GroupChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Group

HasID Channel GuildChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Guild

HasID Channel Category Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Guild.Category

HasID Channel TextChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Guild.Text

HasID Channel VoiceChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Guild.Voice

HasID Channel ChannelMention Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Message

HasID Channel Message Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Message

HasID Channel UpdatedMessage Source # 
Instance details

Defined in Calamity.Types.Model.Channel.UpdatedMessage

HasID Attachment Attachment Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Attachment

HasID DMChannel DMChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.DM

HasID GroupChannel GroupChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Group

HasID GuildChannel GuildChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Guild

HasID Category Category Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Guild.Category

HasID TextChannel TextChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Guild.Text

HasID VoiceChannel VoiceChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Guild.Voice

HasID Message FullContext Source # 
Instance details

Defined in Calamity.Commands.Context

HasID Message LightContext Source # 
Instance details

Defined in Calamity.Commands.Context

HasID Message ReactionEvtData Source # 
Instance details

Defined in Calamity.Gateway.DispatchEvents

HasID Message Message Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Message

HasID Message UpdatedMessage Source # 
Instance details

Defined in Calamity.Types.Model.Channel.UpdatedMessage

HasID Webhook MessageAuthorWebhook Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Message

HasID Webhook Webhook Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Webhook

HasID AuditLogEntry AuditLogEntry Source # 
Instance details

Defined in Calamity.Types.Model.Guild.AuditLog

HasID Emoji Emoji Source # 
Instance details

Defined in Calamity.Types.Model.Guild.Emoji

HasID Guild GuildChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Guild

HasID Guild TextChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Guild.Text

HasID Guild VoiceChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Guild.Voice

HasID Guild BanData Source # 
Instance details

Defined in Calamity.Types.Model.Guild.Ban

HasID Guild Guild Source # 
Instance details

Defined in Calamity.Types.Model.Guild.Guild

HasID Guild UpdatedGuild Source # 
Instance details

Defined in Calamity.Types.Model.Guild.Guild

HasID Guild UnavailableGuild Source # 
Instance details

Defined in Calamity.Types.Model.Guild.UnavailableGuild

HasID Guild Presence Source # 
Instance details

Defined in Calamity.Types.Model.Presence.Presence

HasID Member Member Source # 
Instance details

Defined in Calamity.Types.Model.Guild.Member

HasID Member User Source # 
Instance details

Defined in Calamity.Types.Model.User

HasID Overwrite Overwrite Source # 
Instance details

Defined in Calamity.Types.Model.Guild.Overwrite

HasID Role Role Source # 
Instance details

Defined in Calamity.Types.Model.Guild.Role

HasID Application Interaction Source # 
Instance details

Defined in Calamity.Types.Model.Interaction

HasID Interaction Interaction Source # 
Instance details

Defined in Calamity.Types.Model.Interaction

HasID User FullContext Source # 
Instance details

Defined in Calamity.Commands.Context

HasID User LightContext Source # 
Instance details

Defined in Calamity.Commands.Context

HasID User ReactionEvtData Source # 
Instance details

Defined in Calamity.Gateway.DispatchEvents

HasID User GroupChannel Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Group

HasID User Message Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Message

HasID User MessageAuthor Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Message

HasID User AuditLogEntry Source # 
Instance details

Defined in Calamity.Types.Model.Guild.AuditLog

HasID User BanData Source # 
Instance details

Defined in Calamity.Types.Model.Guild.Ban

HasID User Member Source # 
Instance details

Defined in Calamity.Types.Model.Guild.Member

HasID User Presence Source # 
Instance details

Defined in Calamity.Types.Model.Presence.Presence

HasID User User Source # 
Instance details

Defined in Calamity.Types.Model.User

HasID Channel (Partial Channel) Source # 
Instance details

Defined in Calamity.Types.Model.Channel

HasID Channel (Partial Message) Source # 
Instance details

Defined in Calamity.Types.Model.Channel.Message

HasID Emoji (Partial Emoji) Source # 
Instance details

Defined in Calamity.Types.Model.Guild.Emoji

HasID Guild (Partial Guild) Source # 
Instance details

Defined in Calamity.Types.Model.Guild.Guild

HasID User (Partial User) Source # 
Instance details

Defined in Calamity.Types.Model.User

HasID a (Snowflake a) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Methods

getID :: Snowflake a -> Snowflake a Source #

(HasID b c, HasField field a c) => HasID b (HasIDField field a) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Methods

getID :: HasIDField field a -> Snowflake b Source #

(HasID c d, HasField field a d) => HasID b (HasIDFieldCoerce field a c) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Methods

getID :: HasIDFieldCoerce field a c -> Snowflake b Source #

type HasID' a = HasID a a Source #

newtype HasIDField field a Source #

A newtype wrapper for deriving HasID generically

Constructors

HasIDField a 

Instances

Instances details
(HasID b c, HasField field a c) => HasID b (HasIDField field a) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Methods

getID :: HasIDField field a -> Snowflake b Source #

newtype HasIDFieldCoerce field a c Source #

A data a which contains an ID of type `Snowflake c` which should be swapped with `Snowflake b` upon fetching

Constructors

HasIDFieldCoerce a 

Instances

Instances details
(HasID c d, HasField field a d) => HasID b (HasIDFieldCoerce field a c) Source # 
Instance details

Defined in Calamity.Types.Snowflake

Methods

getID :: HasIDFieldCoerce field a c -> Snowflake b Source #

type HasIDFieldCoerce' field a = HasIDFieldCoerce field a a Source #