-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathBotMessage.cs
More file actions
90 lines (85 loc) · 2.77 KB
/
BotMessage.cs
File metadata and controls
90 lines (85 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using System;
using System.Collections.Generic;
using System.Threading;
using SlackNet.Blocks;
using SlackNet.WebApi;
namespace SlackNet.Bot;
public class BotMessage
{
private ConversationIdentifier _conversation;
private HubIdentifier _hub;
/// <summary>
/// Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.
/// </summary>
public ConversationIdentifier Conversation
{
get => _conversation;
set
{
_conversation = value;
_hub = value;
}
}
/// <summary>
/// Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.
/// </summary>
[Obsolete("Use Conversation instead")]
public HubIdentifier Hub
{
get => _hub;
set
{
_conversation = value;
_hub = value;
}
}
/// <summary>
/// Text of the message to send.
/// </summary>
public string Text { get; set; }
/// <summary>
/// Change how messages are treated.
/// </summary>
public ParseMode Parse { get; set; }
/// <summary>
/// Find and link channel names and usernames.
/// </summary>
public bool LinkNames { get; set; }
/// <summary>
/// Structured message attachments.
/// </summary>
public IList<Attachment> Attachments { get; set; } = [];
/// <summary>
/// Structured blocks.
/// </summary>
public IList<Block> Blocks { get; set; } = [];
/// <summary>
/// Pass True to enable unfurling of primarily text-based content.
/// </summary>
public bool UnfurlLinks { get; set; }
/// <summary>
/// Pass False to disable unfurling of media content.
/// </summary>
public bool UnfurlMedia { get; set; } = true;
/// <summary>
/// Message being replied to. Reply will be in same channel & thread by default.
/// </summary>
public SlackMessage ReplyTo { get; set; }
/// <summary>
/// Indicates whether message in a thread should be made visible to everyone in the channel or conversation.
/// </summary>
public bool ReplyBroadcast { get; set; }
/// <summary>
/// Set to True to reply in a new thread if not already in one.
/// </summary>
public bool CreateThread { get; set; }
/// <summary>
/// Set to True to make this an ephemeral message, which is visible only to the assigned user in a specific public channel, private channel, or private conversation.
/// Note that not all message properties are supported by ephemeral messages.
/// </summary>
public bool Ephemeral { get; set; }
/// <summary>
/// Allows message sending to be cancelled, if it hasn't already been sent.
/// </summary>
public CancellationToken CancellationToken { get; set; }
}