Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Things that are messageable
Synopsis
- class ToMessage a where
- intoMsg :: a -> Endo CreateMessageOptions
- class Tellable a where
- newtype TMention a = TMention (Snowflake a)
- tell :: forall msg r t. (BotC r, ToMessage msg, Tellable t) => t -> msg -> Sem r (Either RestError Message)
- reply :: forall msg r t. (BotC r, ToMessage msg, HasID Channel t, HasID Message t) => t -> msg -> Sem r (Either RestError Message)
- runToMessage :: ToMessage a => a -> CreateMessageOptions
Documentation
class ToMessage a where Source #
Things that can be used to send a message
Can be used to compose text, embeds, and files. e.g.
intoMsg
Text
"A message"<>
intoMsg
Embed
(def
&
#description?~
"Embed description")
intoMsg :: a -> Endo CreateMessageOptions Source #
Turn a
into a CreateMessageOptions
builder
Instances
ToMessage AllowedMentions Source # | Allowed mentions, |
Defined in Calamity.Types.Tellable | |
ToMessage CreateMessageAttachment Source # | Message attachments, |
Defined in Calamity.Types.Tellable | |
ToMessage CreateMessageOptions Source # | |
Defined in Calamity.Types.Tellable | |
ToMessage Button Source # | Add a singleton row containing a |
Defined in Calamity.Types.Tellable | |
ToMessage Component Source # | Add a singleton row containing a If the component is not already an actionrow, it is wrapped in a singleton row |
Defined in Calamity.Types.Tellable | |
ToMessage LinkButton Source # | Add a singleton row containing a |
Defined in Calamity.Types.Tellable | |
ToMessage Select Source # | Add a singleton row containing a |
Defined in Calamity.Types.Tellable | |
ToMessage Embed Source # | Message embed, |
Defined in Calamity.Types.Tellable | |
ToMessage MessageReference Source # | Set a |
Defined in Calamity.Types.Tellable | |
ToMessage Text Source # | Message content, |
Defined in Calamity.Types.Tellable | |
ToMessage Text Source # | Message content, |
Defined in Calamity.Types.Tellable | |
ToMessage String Source # | Message content, |
Defined in Calamity.Types.Tellable | |
ToMessage (Endo CreateMessageOptions) Source # | |
Defined in Calamity.Types.Tellable | |
ToMessage (TMention Member) Source # | Add a |
Defined in Calamity.Types.Tellable | |
ToMessage (TMention Role) Source # | Add a |
Defined in Calamity.Types.Tellable | |
ToMessage (TMention User) Source # | Add a |
Defined in Calamity.Types.Tellable | |
ToMessage [Button] Source # | Add an row of |
Defined in Calamity.Types.Tellable | |
ToMessage [Component] Source # | Add many components to a message. Each component will be wrapped in a singleton ActionRow if not already |
Defined in Calamity.Types.Tellable | |
ToMessage [LinkButton] Source # | Add an row of |
Defined in Calamity.Types.Tellable intoMsg :: [LinkButton] -> Endo CreateMessageOptions Source # | |
ToMessage [Select] Source # | Add an row of |
Defined in Calamity.Types.Tellable | |
ToMessage (CreateMessageOptions -> CreateMessageOptions) Source # | |
Defined in Calamity.Types.Tellable |
class Tellable a where Source #
Instances
Tellable FullContext Source # | |
Defined in Calamity.Commands.Context | |
Tellable LightContext Source # | |
Defined in Calamity.Commands.Context | |
Tellable Channel Source # | |
Tellable DMChannel Source # | |
Tellable TextChannel Source # | |
Defined in Calamity.Types.Tellable | |
Tellable Message Source # | |
Tellable Member Source # | |
Tellable User Source # | |
Tellable (Snowflake Channel) Source # | |
Tellable (Snowflake DMChannel) Source # | |
Tellable (Snowflake TextChannel) Source # | |
Defined in Calamity.Types.Tellable | |
Tellable (Snowflake Member) Source # | |
Tellable (Snowflake User) Source # | |
A wrapper type for allowing mentions
Instances
Show (TMention a) Source # | |
ToMessage (TMention Member) Source # | Add a |
Defined in Calamity.Types.Tellable | |
ToMessage (TMention Role) Source # | Add a |
Defined in Calamity.Types.Tellable | |
ToMessage (TMention User) Source # | Add a |
Defined in Calamity.Types.Tellable |
tell :: forall msg r t. (BotC r, ToMessage msg, Tellable t) => t -> msg -> Sem r (Either RestError Message) Source #
reply :: forall msg r t. (BotC r, ToMessage msg, HasID Channel t, HasID Message t) => t -> msg -> Sem r (Either RestError Message) Source #
runToMessage :: ToMessage a => a -> CreateMessageOptions Source #