mirror of
https://github.com/NoiTheCat/WorldTime.git
synced 2024-11-21 06:34:36 +00:00
Support new username format
This commit is contained in:
parent
2861b579b4
commit
aa3907466c
3 changed files with 14 additions and 6 deletions
|
@ -66,11 +66,18 @@ public class CommandsBase : InteractionModuleBase<ShardedInteractionContext> {
|
|||
return result.ToString();
|
||||
}
|
||||
|
||||
var username = escapeFormattingCharacters(user.Username);
|
||||
if (user.Nickname != null) {
|
||||
return $"**{escapeFormattingCharacters(user.Nickname)}** ({username}#{user.Discriminator})";
|
||||
if (user.DiscriminatorValue == 0) {
|
||||
if (user.Nickname != null) {
|
||||
return $"**{escapeFormattingCharacters(user.Nickname)}** ({escapeFormattingCharacters(user.ToString())})";
|
||||
}
|
||||
return user.ToString();
|
||||
} else {
|
||||
var username = escapeFormattingCharacters(user.Username);
|
||||
if (user.Nickname != null) {
|
||||
return $"**{escapeFormattingCharacters(user.Nickname)}** ({username}#{user.Discriminator})";
|
||||
}
|
||||
return $"**{username}**#{user.Discriminator}";
|
||||
}
|
||||
return $"**{username}**#{user.Discriminator}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -41,7 +41,8 @@ internal class WorldTime : IDisposable {
|
|||
MessageCacheSize = 0, // disable message cache
|
||||
GatewayIntents = GatewayIntents.Guilds | GatewayIntents.GuildMembers,
|
||||
SuppressUnknownDispatchWarnings = true,
|
||||
LogGatewayIntentWarnings = false
|
||||
LogGatewayIntentWarnings = false,
|
||||
FormatUsersInBidirectionalUnicode = false
|
||||
};
|
||||
_services = new ServiceCollection()
|
||||
.AddSingleton(new DiscordShardedClient(clientConf))
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CommandLineParser" Version="2.9.1" />
|
||||
<PackageReference Include="Discord.Net" Version="3.9.0" />
|
||||
<PackageReference Include="Discord.Net" Version="3.12.0" />
|
||||
<PackageReference Include="EFCore.NamingConventions" Version="7.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.2" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.2">
|
||||
|
|
Loading…
Reference in a new issue