public ChannelInfo this[DirectMessageConversation im] { get { return(this[im.id]); } }
public MessageHistory GetDMHistory(DirectMessageConversation convo) { MessageHistory msgHistory = null; Connect(); Slack.GetDirectMessageHistory((history) => { msgHistory = history; ClientReady.Set(); }, convo); ClientReady.Wait(); ClientReady.Reset(); return(msgHistory); }
/// <summary> /// Simplified message to a user /// </summary> /// <param name="Message">String :"Message"</param> /// <param name="client">client</param> /// <param name="userchannelid">userchannelid</param> void MessageTo(string Message, SlackSocketClient client, DirectMessageConversation userchannelid, MessageType type) { Connected = null; client.Connect(Connected => { if (type != MessageType.Crash) { client.SendMessage(null, userchannelid.id, Message); } else { client.SendMessage(null, userchannelid.id, "Crash :" + Message); } }); }
private void UpdateChannelInfo(DirectMessageConversation im) { this.Logger.Debug($"Init IM {this.GetReadableName(im.id)}"); // Search in unread history if (im.unread_count > 0) { using (ManualResetEventSlim waiter = new ManualResetEventSlim()) { this.Client.GetDirectMessageHistory( x => { this.channelsInfo[im].UnreadMessage = x.messages.Count(this.IsRegularMessage); this.channelsInfo[im].UnreadMention = this.channelsInfo[im].UnreadMessage; waiter.Set(); }, im, null, null, im.unread_count); waiter.Wait(Timeout); } } }
public void sendDirectMessage(string message, string nameUser = "******") { DirectMessageConversation dmchannel = DirectMessagesByUser(nameUser); _Client.PostMessage(null, dmchannel.id, message); }
private bool ShouldMonitor(DirectMessageConversation im) { return(im.is_user_deleted == false); }
public DirectMessageAdapter(DirectMessageConversation info, ConnectedInterface connected, SlackClient client) { this.info = info; this.connected = connected; this.client = client; }
private ChatChannel ToChatChannel(DirectMessageConversation dm) { return(new ChatChannel(dm.id, socketClient.UserLookup[dm.user].name, true)); }