public static async Task SendPM(ulong userId, IDiscordEmbed embed, DatabaseEntityType entityType = DatabaseEntityType.USER, DatabaseSettingId settingId = DatabaseSettingId.PERSONALMESSAGE) { IUser m = Bot.instance.Client.GetUser(userId); IDiscordUser user = new RuntimeUser(m); if (CanSendNotification(userId, entityType, settingId)) { await user?.SendMessage(embed); } }
public static async Task SendPM(ulong userId, string message, DatabaseEntityType entityType = DatabaseEntityType.USER, DatabaseSettingId settingId = DatabaseSettingId.PERSONALMESSAGE) { IUser m = Bot.instance.Client.GetUser(userId); IDiscordUser user = new RuntimeUser(m); if (CanSendNotification(userId, entityType, settingId)) { RuntimeEmbed e = new RuntimeEmbed(new Discord.EmbedBuilder()); e.Title = "NOTIFICATION"; e.Description = message; await user?.SendMessage(e); Log.Message("Sent notification to " + user.Username); } }