-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change: objects class move to the Models folder, List will all the slackChannel(Group, DM, Channels). Father class SlackChannel from all channels(Group, DM, Channels). Fix bug when the socket receive a message with type null. Fix the error when the slackSocketClient try open socket with LoginReponse is not Ok, Add more events, and now the event pass back the slackclient/slacksocketclient
- Loading branch information
1 parent
ea9f946
commit 2389db1
Showing
96 changed files
with
754 additions
and
681 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace SlackAPI.Models | ||
{ | ||
//See: https://api.slack.com/docs/attachments | ||
public class Attachment | ||
{ | ||
[JsonProperty(PropertyName = "fallback")] | ||
public string Fallback { get; set; } | ||
|
||
[JsonProperty(PropertyName = "color")] | ||
public string Color { get; set; } | ||
|
||
[JsonProperty(PropertyName = "pretext")] | ||
public string Pretext { get; set; } | ||
|
||
[JsonProperty(PropertyName = "author_name")] | ||
public string AuthorName { get; set; } | ||
|
||
[JsonProperty(PropertyName = "author_link")] | ||
public string AuthorLink { get; set; } | ||
|
||
[JsonProperty(PropertyName = "author_icon")] | ||
public string AuthorIcon { get; set; } | ||
|
||
[JsonProperty(PropertyName = "title")] | ||
public string Title { get; set; } | ||
|
||
[JsonProperty(PropertyName = "title_link")] | ||
public string TitleLink { get; set; } | ||
|
||
[JsonProperty(PropertyName = "text")] | ||
public string Text { get; set; } | ||
|
||
[JsonProperty(PropertyName = "fields")] | ||
public Field[] Fields { get; set; } | ||
|
||
[JsonProperty(PropertyName = "image_url")] | ||
public string ImageUrl { get; set; } | ||
|
||
[JsonProperty(PropertyName = "thumb_url")] | ||
public string ThumbUrl { get; set; } | ||
|
||
[JsonProperty(PropertyName = "mrkdwn_in")] | ||
public string[] MrkdwnIn { get; set; } | ||
} | ||
|
||
public class Field{ | ||
[JsonProperty(PropertyName = "title")] | ||
public string Title { get; set; } | ||
|
||
[JsonProperty(PropertyName = "value")] | ||
public string Value { get; set; } | ||
|
||
[JsonProperty(PropertyName = "short")] | ||
public bool IsShort { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
using System; | ||
|
||
namespace SlackAPI | ||
namespace SlackAPI.Models | ||
{ | ||
public class Bot | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
|
||
namespace SlackAPI.Models | ||
{ | ||
/// <summary> | ||
/// https://api.slack.com/types/channel | ||
/// </summary> | ||
public class Channel : SlackChannel | ||
{ | ||
[JsonProperty(PropertyName = "is_channel")] | ||
public bool IsChannel { get; set; } | ||
|
||
/// <summary> | ||
/// Is the user ID of the member that created this private channel. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "creator")] | ||
public string CreatorUserId { get; set; } | ||
|
||
/// <summary> | ||
/// Will be true if the channel is archived. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "is_archived")] | ||
public bool IsArchived { get; set; } | ||
|
||
[JsonProperty(PropertyName = "is_mpim")] | ||
public bool IsMpim { get; set; } | ||
|
||
/// <summary> | ||
/// Is a list of user ids for all users in this channel. | ||
/// This includes any disabled accounts that were in this channel when they were disabled. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "members")] | ||
public string[] Members { get; set; } | ||
|
||
/// <summary> | ||
/// Will be true if the calling member is part of the channel. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "is_member")] | ||
public bool IsMember { get; set; } | ||
|
||
/// <summary> | ||
/// Will be true if this channel is the "general" channel that includes all regular team members. | ||
/// In most teams this is called #general but some teams have renamed it. | ||
/// </summary> | ||
[JsonProperty(PropertyName = "is_general")] | ||
public bool IsGeneral { get; set; } | ||
|
||
[JsonProperty(PropertyName = "is_group")] | ||
public bool IsGroup { get; set; } | ||
|
||
[Obsolete] | ||
[JsonProperty(PropertyName = "num_members")] | ||
public int NumMembers { get; set; } | ||
|
||
/// <summary> | ||
/// Provide information about the channel topic | ||
/// </summary> | ||
[JsonProperty(PropertyName = "topic")] | ||
public OwnedStampedMessage Topic { get; set; } | ||
|
||
/// <summary> | ||
/// Provide information about the channel purpose | ||
/// </summary> | ||
[JsonProperty(PropertyName = "purpose")] | ||
public OwnedStampedMessage Purpose { get; set; } | ||
|
||
public override SlackChannelType Type { get { return IsChannel ? SlackChannelType.Channel : SlackChannelType.Group; } } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
2389db1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty big refactor.
Skimming over it, are you still supporting the original object only callback?