コード例 #1
0
 public static Task LogAsync(LogSeverity severity, string source, string message)
 {
     PrettyPrint.WriteLine($"[{severity}] \t", ConsoleColor.DarkMagenta);
     PrettyPrint.Write($"{source}: ", ConsoleColor.Blue);
     PrettyPrint.Write(message, ConsoleColor.White);
     return(Task.CompletedTask);
 }
コード例 #2
0
        public override IConfigurationBase GetOrCreateConfiguration()
        {
            Configurations config = base.GetOrCreateConfiguration() as Configurations;

            if (config.Tokens.DiscordBotToken == "")
            {
                PrettyPrint.Log(LogSeverity.Info, "Token", "Please enter your discord bot token: ");
                string intoken = Console.ReadLine();

                Tokens.DiscordBotToken = intoken;
                SaveJson();
            }

            return(config);
        }
コード例 #3
0
        public static void Log(CommandContext c)
        {
            var channel = (c.Channel as SocketGuildChannel);

            PrettyPrint.WriteLine();

            if (channel == null)
            {
                PrettyPrint.Write($"[PM] ", ConsoleColor.Magenta);
            }
            else
            {
                PrettyPrint.Write($"[{c.Guild.Name} #{channel.Name}] ", ConsoleColor.DarkGreen);
            }

            PrettyPrint.Write($"{c.User}: ", ConsoleColor.Green);
            PrettyPrint.Write(c.Message.Content, ConsoleColor.White);
        }
コード例 #4
0
        public static void Log(IUserMessage msg)
        {
            var channel = (msg.Channel as IGuildChannel);

            PrettyPrint.WriteLine();

            if (channel?.Guild == null)
            {
                PrettyPrint.Write($"[PM] ", ConsoleColor.Magenta);
            }
            else
            {
                PrettyPrint.Write($"[{channel.Guild.Name} #{channel.Name}] ", ConsoleColor.DarkGreen);
            }

            PrettyPrint.Write($"{msg.Author}: ", ConsoleColor.Green);
            PrettyPrint.Write(msg.Content, ConsoleColor.White);
        }
コード例 #5
0
 public static void Log(object severity, string source, string message)
 {
     PrettyPrint.WriteLine($"[{severity}] ", ConsoleColor.DarkMagenta);
     PrettyPrint.Write($"{source}: ", ConsoleColor.Blue);
     PrettyPrint.Write(message, ConsoleColor.White);
 }
コード例 #6
0
 private static void TimeStamp()
 {
     PrettyPrint.Write($"{DateTime.Now.ToString("hh:mm:ss")} ", ConsoleColor.DarkGray);
 }