Revert SimpleContextConverter
This commit is contained in:
parent
a616d42543
commit
e158e2196f
1 changed files with 27 additions and 1 deletions
|
@ -8,7 +8,33 @@ namespace Geekbot.net.Lib
|
|||
{
|
||||
public static MessageDto ConvertContext(ICommandContext context)
|
||||
{
|
||||
return ConvertSocketMessage((SocketMessage) context.Message);
|
||||
return new MessageDto()
|
||||
{
|
||||
Message = new MessageDto.MessageContent()
|
||||
{
|
||||
Content = context.Message.Content,
|
||||
Id = context.Message.Id.ToString(),
|
||||
Attachments = context.Message.Attachments.Count,
|
||||
ChannelMentions = context.Message.MentionedChannelIds.Count,
|
||||
UserMentions = context.Message.MentionedUserIds.Count,
|
||||
RoleMentions = context.Message.MentionedRoleIds.Count
|
||||
},
|
||||
User = new MessageDto.IdAndName()
|
||||
{
|
||||
Id = context.User.Id.ToString(),
|
||||
Name = $"{context.User.Username}#{context.User.Discriminator}"
|
||||
},
|
||||
Guild = new MessageDto.IdAndName()
|
||||
{
|
||||
Id = context.Guild.Id.ToString(),
|
||||
Name = context.Guild.Name
|
||||
},
|
||||
Channel = new MessageDto.IdAndName()
|
||||
{
|
||||
Id = context.Channel.Id.ToString(),
|
||||
Name = context.Channel.Name
|
||||
}
|
||||
};
|
||||
}
|
||||
public static MessageDto ConvertSocketMessage(SocketMessage message)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue