static void Main(string[] args) { GreetingsService service = new GreetingsService(); service.SayHello("Adam"); service.SayGoodbye("Adam"); }
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."); }
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}"); }
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}"); }
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"}"); }
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(); }
public Greetings(GreetingsService greetingsService, HelpService helpService) { GreetingsService = greetingsService; HelpService = helpService; }