discord-haskell-1.14.0: Write bots for Discord in Haskell
Safe HaskellNone
LanguageHaskell2010

Discord.Internal.Rest.Channel

Description

Provides actions for Channel API interactions

Synopsis

Documentation

data ChannelRequest a where Source #

Data constructor for requests. See API

Constructors

GetChannel :: ChannelId -> ChannelRequest Channel

Gets a channel by its id.

ModifyChannel :: ChannelId -> ModifyChannelOpts -> ChannelRequest Channel

Edits channels options.

DeleteChannel :: ChannelId -> ChannelRequest Channel

Deletes a channel if its id doesn't equal to the id of guild.

GetChannelMessages :: ChannelId -> (Int, MessageTiming) -> ChannelRequest [Message]

Gets a messages from a channel with limit of 100 per request.

GetChannelMessage :: (ChannelId, MessageId) -> ChannelRequest Message

Gets a message in a channel by its id.

CreateMessage :: ChannelId -> Text -> ChannelRequest Message

Sends a message to a channel.

CreateMessageDetailed :: ChannelId -> MessageDetailedOpts -> ChannelRequest Message

Sends a message with granular controls.

CreateReaction :: (ChannelId, MessageId) -> Text -> ChannelRequest ()

Add an emoji reaction to a message. ID must be present for custom emoji

DeleteOwnReaction :: (ChannelId, MessageId) -> Text -> ChannelRequest ()

Remove a Reaction this bot added

DeleteUserReaction :: (ChannelId, MessageId) -> UserId -> Text -> ChannelRequest ()

Remove a Reaction someone else added

DeleteSingleReaction :: (ChannelId, MessageId) -> Text -> ChannelRequest ()

Deletes all reactions of a single emoji on a message

GetReactions :: (ChannelId, MessageId) -> Text -> (Int, ReactionTiming) -> ChannelRequest [User]

List of users that reacted with this emoji

DeleteAllReactions :: (ChannelId, MessageId) -> ChannelRequest ()

Delete all reactions on a message

EditMessage :: (ChannelId, MessageId) -> MessageDetailedOpts -> ChannelRequest Message

Edits a message content.

DeleteMessage :: (ChannelId, MessageId) -> ChannelRequest ()

Deletes a message.

BulkDeleteMessage :: (ChannelId, [MessageId]) -> ChannelRequest ()

Deletes a group of messages.

EditChannelPermissions :: ChannelId -> Either RoleId UserId -> ChannelPermissionsOpts -> ChannelRequest ()

Edits a permission overrides for a channel.

GetChannelInvites :: ChannelId -> ChannelRequest Object

Gets all instant invites to a channel.

CreateChannelInvite :: ChannelId -> ChannelInviteOpts -> ChannelRequest Invite

Creates an instant invite to a channel.

DeleteChannelPermission :: ChannelId -> Either RoleId UserId -> ChannelRequest ()

Deletes a permission override from a channel.

TriggerTypingIndicator :: ChannelId -> ChannelRequest ()

Sends a typing indicator a channel which lasts 10 seconds.

GetPinnedMessages :: ChannelId -> ChannelRequest [Message]

Gets all pinned messages of a channel.

AddPinnedMessage :: (ChannelId, MessageId) -> ChannelRequest ()

Pins a message.

DeletePinnedMessage :: (ChannelId, MessageId) -> ChannelRequest ()

Unpins a message.

GroupDMAddRecipient :: ChannelId -> GroupDMAddRecipientOpts -> ChannelRequest ()

Adds a recipient to a Group DM using their access token

GroupDMRemoveRecipient :: ChannelId -> UserId -> ChannelRequest ()

Removes a recipient from a Group DM

StartThreadFromMessage :: ChannelId -> MessageId -> StartThreadOpts -> ChannelRequest Channel

Start a thread from a message

StartThreadNoMessage :: ChannelId -> StartThreadNoMessageOpts -> ChannelRequest Channel

Start a thread without a message

JoinThread :: ChannelId -> ChannelRequest ()

Join a thread

AddThreadMember :: ChannelId -> UserId -> ChannelRequest ()

Add a thread member

LeaveThread :: ChannelId -> ChannelRequest ()

Leave a thread

RemoveThreadMember :: ChannelId -> UserId -> ChannelRequest ()

Remove a thread member

GetThreadMember :: ChannelId -> UserId -> ChannelRequest ThreadMember

Get a thread member

ListThreadMembers :: ChannelId -> ChannelRequest [ThreadMember]

List the thread members

ListPublicArchivedThreads :: ChannelId -> (Maybe UTCTime, Maybe Integer) -> ChannelRequest ListThreads

List public archived threads in the given channel. Optionally before a given time, and optional maximum number of threads. Returns the threads, thread members, and whether there are more to collect. Requires the READ_MESSAGE_HISTORY permission.

ListPrivateArchivedThreads :: ChannelId -> (Maybe UTCTime, Maybe Integer) -> ChannelRequest ListThreads

List private archived threads in the given channel. Optionally before a given time, and optional maximum number of threads. Returns the threads, thread members, and whether there are more to collect. Requires both the READ_MESSAGE_HISTORY and MANAGE_THREADS permissions.

ListJoinedPrivateArchivedThreads :: ChannelId -> (Maybe UTCTime, Maybe Integer) -> ChannelRequest ListThreads

List joined private archived threads in the given channel. Optionally before a given time, and optional maximum number of threads. Returns the threads, thread members, and whether there are more to collect. Requires both the READ_MESSAGE_HISTORY and MANAGE_THREADS permissions.

Instances

Instances details
Request (ChannelRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

data MessageDetailedOpts Source #

Options for CreateMessageDetailed requests.

Constructors

MessageDetailedOpts 

Fields

data AllowedMentions Source #

Data constructor for a part of MessageDetailedOpts.

Constructors

AllowedMentions 

Fields

Instances

Instances details
Eq AllowedMentions Source # 
Instance details

Defined in Discord.Internal.Types.Channel

Ord AllowedMentions Source # 
Instance details

Defined in Discord.Internal.Types.Channel

Read AllowedMentions Source # 
Instance details

Defined in Discord.Internal.Types.Channel

Show AllowedMentions Source # 
Instance details

Defined in Discord.Internal.Types.Channel

ToJSON AllowedMentions Source # 
Instance details

Defined in Discord.Internal.Types.Channel

Default AllowedMentions Source # 
Instance details

Defined in Discord.Internal.Types.Channel

data ChannelInviteOpts Source #

Options for CreateChannelInvite requests

Constructors

ChannelInviteOpts 

Fields

Instances

Instances details
Eq ChannelInviteOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

Ord ChannelInviteOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

Read ChannelInviteOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

Show ChannelInviteOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

ToJSON ChannelInviteOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

data ModifyChannelOpts Source #

Options for ModifyChannel requests

Constructors

ModifyChannelOpts 

Fields

Instances

Instances details
Eq ModifyChannelOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

Ord ModifyChannelOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

Read ModifyChannelOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

Show ModifyChannelOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

ToJSON ModifyChannelOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

Default ModifyChannelOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

data ChannelPermissionsOpts Source #

Options for The EditChannelPermissions request

Since the JSON encoding of this datatype will require information in the route (the Either decides whether the overwrite is for a user or a role), we do not provide a ToJSON instance. Instead, the JSON is manually constructed in the channelJsonRequest function.

Constructors

ChannelPermissionsOpts 

Fields

data GroupDMAddRecipientOpts Source #

Constructors

GroupDMAddRecipientOpts 

Fields

data StartThreadOpts Source #

Options for StartThreadFromMessage request

Constructors

StartThreadOpts 

Fields

data StartThreadNoMessageOpts Source #

Options for StartThreadNoMessage request

Constructors

StartThreadNoMessageOpts 

Fields

Instances

Instances details
Eq StartThreadNoMessageOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

Ord StartThreadNoMessageOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

Read StartThreadNoMessageOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

Show StartThreadNoMessageOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

ToJSON StartThreadNoMessageOpts Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

data ListThreads Source #

Constructors

ListThreads 

Fields