本文整理汇总了C#中Discord.DiscordClient.RaiseOnDebugMessage方法的典型用法代码示例。如果您正苦于以下问题:C# DiscordClient.RaiseOnDebugMessage方法的具体用法?C# DiscordClient.RaiseOnDebugMessage怎么用?C# DiscordClient.RaiseOnDebugMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Discord.DiscordClient
的用法示例。
在下文中一共展示了DiscordClient.RaiseOnDebugMessage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Server
internal Server(string id, DiscordClient client)
{
Id = id;
_client = client;
_bans = new ConcurrentDictionary<string, bool>();
_members = new AsyncCache<Membership, API.Models.MemberInfo>(
(key, parentKey) =>
{
if (_client.IsDebugMode)
_client.RaiseOnDebugMessage(DebugMessageType.Cache, $"Created user {key} in server {parentKey}.");
return new Membership(parentKey, key, _client);
},
(member, model) =>
{
if (model is API.Models.PresenceMemberInfo)
{
var extendedModel = model as API.Models.PresenceMemberInfo;
member.Status = extendedModel.Status;
member.GameId = extendedModel.GameId;
}
if (model is API.Models.VoiceMemberInfo)
{
var extendedModel = model as API.Models.VoiceMemberInfo;
member.VoiceChannelId = extendedModel.ChannelId;
member.IsDeafened = extendedModel.IsDeafened;
member.IsMuted = extendedModel.IsMuted;
if (extendedModel.IsSelfDeafened.HasValue)
member.IsSelfDeafened = extendedModel.IsSelfDeafened.Value;
if (extendedModel.IsSelfMuted.HasValue)
member.IsSelfMuted = extendedModel.IsSelfMuted.Value;
member.IsSuppressed = extendedModel.IsSuppressed;
member.SessionId = extendedModel.SessionId;
member.Token = extendedModel.Token;
}
if (model is API.Models.RoleMemberInfo)
{
var extendedModel = model as API.Models.RoleMemberInfo;
member.RoleIds = extendedModel.Roles;
if (extendedModel.JoinedAt.HasValue)
member.JoinedAt = extendedModel.JoinedAt.Value;
}
if (model is API.Models.InitialMemberInfo)
{
var extendedModel = model as API.Models.InitialMemberInfo;
member.IsDeafened = extendedModel.IsDeafened;
member.IsMuted = extendedModel.IsMuted;
}
if (_client.IsDebugMode)
_client.RaiseOnDebugMessage(DebugMessageType.Cache, $"Updated user {member.User?.Name} ({member.UserId}) in server {member.Server?.Name} ({member.ServerId}).");
},
(member) =>
{
if (_client.IsDebugMode)
_client.RaiseOnDebugMessage(DebugMessageType.Cache, $"Destroyed user {member.User?.Name} ({member.UserId}) in server {member.Server?.Name} ({member.ServerId}).");
}
);
}