Feature/update libs #98
|
@ -232,6 +232,7 @@ namespace DML.AppCore.Classes
|
|||
var extensionRequired = !fileName.EndsWith("%name%");
|
||||
|
||||
var serverName = "unknown";
|
||||
string nickname = null;
|
||||
|
||||
var socketTextChannel = message.Channel as SocketTextChannel;
|
||||
if (socketTextChannel != null)
|
||||
|
@ -239,6 +240,7 @@ namespace DML.AppCore.Classes
|
|||
serverName = socketTextChannel.Guild.Name;
|
||||
serverName = Path.GetInvalidFileNameChars()
|
||||
.Aggregate(serverName, (current, c) => current.Replace(c, ' '));
|
||||
nickname = socketTextChannel.GetUser(message.Author.Id).Nickname;
|
||||
}
|
||||
|
||||
var channelName = message.Channel.Name;
|
||||
|
@ -252,7 +254,9 @@ namespace DML.AppCore.Classes
|
|||
.Replace("%name%", a.Filename)
|
||||
.Replace("%id%", a.Id.ToString())
|
||||
.Replace("%userid%", message.Author.Id.ToString())
|
||||
.Replace("%username%", message.Author.Username);
|
||||
.Replace("%username%", message.Author.Username)
|
||||
.Replace("%nickname%",
|
||||
!string.IsNullOrEmpty(nickname) ? nickname : message.Author.Username);
|
||||
|
||||
if (extensionRequired)
|
||||
fileName += Path.GetExtension(a.Filename);
|
||||
|
|
|
@ -86,7 +86,8 @@ namespace DML.Application.Properties {
|
|||
///%channel% -> channel name
|
||||
///%timestamp% -> message timestamp (Unix timestamp)
|
||||
///%name% -> attachment filename
|
||||
///%username% -> author name
|
||||
///%username% -> author username
|
||||
///%nickname% -> author nickname (if unassigned, username will be used)
|
||||
///%id% -> attachment id (given by Discord)
|
||||
///%userid% -> author id (given by discord) ähnelt.
|
||||
/// </summary>
|
||||
|
|
|
@ -139,7 +139,8 @@ Flaticons (Roundicons Circle Flat) - Flaticon Basic License</value>
|
|||
%channel% -> channel name
|
||||
%timestamp% -> message timestamp (Unix timestamp)
|
||||
%name% -> attachment filename
|
||||
%username% -> author name
|
||||
%username% -> author username
|
||||
%nickname% -> author nickname (if unassigned, username will be used)
|
||||
%id% -> attachment id (given by Discord)
|
||||
%userid% -> author id (given by discord)</value>
|
||||
</data>
|
||||
|
|
Loading…
Reference in a new issue