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