Example #1
0
        public async Task SetTimeZoneAsync(CommandContext ctx, [Description(SetTimeZoneParameterDescription), RemainingText] string timeZoneName)
        {
            await ctx.TriggerTypingAsync();

            if (_timeZoneService.TimeZoneExists(timeZoneName))
            {
                await _timeZoneService.SetTimeZoneAsync(ctx.Guild.Id, timeZoneName);

                var embed = _timeZoneEmbedGenerator.BuildMessageOnSuccess(ctx.RawArgumentString);
                await ctx.RespondAsync(embed : embed);
            }
            else
            {
                var embed = _timeZoneEmbedGenerator.BuildMessageOnError();
                await ctx.RespondAsync(embed : embed);
            }
        }