static void Main(string[] args)
        {
            GreetingsService service = new GreetingsService();
            service.SayHello("Adam");

            service.SayGoodbye("Adam");
        }
Esempio n. 2
0
        public async Task ToggleGoodbye()
        {
            var config = GreetingsService.GetGoodbyeConfig(Context.Guild.Id);

            config.Enabled = !config.Enabled;
            GreetingsService.SaveGoodbyeConfig(config);
            await ReplyAsync($"Display Goodbye Messages: {config.Enabled}\nNOTE: You will need to run the `SetGoodbyeChannel` command or enable dms in order for this to work.");
        }
Esempio n. 3
0
        public async Task ToggleWelcomeDms()
        {
            var config = GreetingsService.GetWelcomeConfig(Context.Guild.Id);

            config.DirectMessage = !config.DirectMessage;
            GreetingsService.SaveWelcomeConfig(config);
            await ReplyAsync($"Display Welcome Messages: {config.Enabled}\n" +
                             $"Direct Message Welcomes: {config.DirectMessage}");
        }
Esempio n. 4
0
        public async Task SetGoodbyeChannel()
        {
            var config = GreetingsService.GetGoodbyeConfig(Context.Guild.Id);

            config.GoodbyeChannel = Context.Channel.Id;
            GreetingsService.SaveGoodbyeConfig(config);
            await ReplyAsync($"Display Goodbye Messages: {config.Enabled}\n" +
                             $"Goodbye channel set to: {Context.Channel.Name}");
        }
Esempio n. 5
0
        public async Task SetGoodbyeMessage([Remainder] string message = null)
        {
            var config = GreetingsService.GetGoodbyeConfig(Context.Guild.Id);

            config.GoodbyeMessage = message;
            GreetingsService.SaveGoodbyeConfig(config);
            await ReplyAsync($"Display Goodbye Messages: {config.Enabled}\n" +
                             $"**Message**\n" +
                             $"{message ?? "DEFAULT"}");
        }
Esempio n. 6
0
        static void Main(string[] args)
        {
            //Compile time polymorphism
            GreetingsService _greetingService = new GreetingsService();

            _greetingService.SayHello("Viktor");
            _greetingService.SayHello("Viktor", "Jakovlev");
            _greetingService.SayHello("Viktor", "Milan", "Jakovlev");
            _greetingService.SayHello("Viktor", "Jakovlev", 31);

            var options = new GreetingsOptions()
            {
                Name       = "Viktor",
                MiddleName = "Milan",
                LastName   = "Jakovlev"
            };

            _greetingService.SayHello(options);

            //Runtime polymorphism
            Dog majlo = new Dog()
            {
                Name      = "Majlo",
                IsGoodBoy = true
            };

            majlo.Eat();

            var george = new Cat()
            {
                Name   = "George",
                IsLazy = false
            };

            george.Eat();

            Console.ReadLine();
        }
Esempio n. 7
0
 public Greetings(GreetingsService greetingsService, HelpService helpService)
 {
     GreetingsService = greetingsService;
     HelpService      = helpService;
 }