public static StandardisedMessageRequest FromTwitch(OnMessageReceivedArgs e, BotInstance BotInstance) { StandardisedMessageRequest S = new StandardisedMessageRequest(); S.MessageBody = e.ChatMessage.Message; S.SegmentedBody = S.MessageBody.Split(" ".ToCharArray()); S.MessageType = MessageType.Twitch; S.SenderID = e.ChatMessage.UserId; S.SenderUserName = e.ChatMessage.Username; S.TwitchRaw = e; S.ChannelName = e.ChatMessage.Channel; S.User = new StandardisedUser(); S.User.ID = S.SenderID; S.User.UserName = S.SenderUserName; S.Viewer = Data.APIIntergrations.RewardCurrencyAPI.Objects.Viewer.FromTwitchDiscord(S, BotInstance, S.User.ID, ref S.IsNewUser); return(S); }
public static StandardisedMessageRequest FromDiscord(SocketMessage e, BotInstance BotInstance) { StandardisedMessageRequest S = new StandardisedMessageRequest(); S.MessageBody = e.Content; S.SegmentedBody = S.MessageBody.Split(" ".ToCharArray()); S.MessageType = MessageType.Discord; S.SenderID = e.Author.Id.ToString(); S.SenderUserName = e.Author.Username; S.DiscordRaw = e; S.ChannelID = e.Channel.Id.ToString(); S.ChannelName = e.Channel.Name; S.User = new StandardisedUser(); S.User.ID = S.SenderID; S.User.UserName = S.SenderUserName; S.Viewer = Data.APIIntergrations.RewardCurrencyAPI.Objects.Viewer.FromTwitchDiscord(S, BotInstance, S.User.ID, ref S.IsNewUser); return(S); }