public async Task SetCalendarId(string calendarId, SocketCommandContext context)
        {
            // grab server by id of current guild via context
            var server = Servers.ServerList.Find(x => x.DiscordServerObject == context.Guild);

            // and its index in the ServerList so we can assign to the ServerList directly
            var serverIndex = Servers.ServerList.IndexOf(server);

            Servers.ServerList[serverIndex].CalendarId = calendarId;

            // and update the database as well
            await _databaseServers.EditServerInfo(server.ServerId, "calendar_id", calendarId);
        }
Ejemplo n.º 2
0
        public async Task ToggleRemindersAsync()
        {
            var server = DbDiscordServers.ServerList.Find(x => x.DiscordServerObject == Context.Guild);

            if (server.RemindersEnabled)
            {
                server.RemindersEnabled = false;
            }
            else if (server.RemindersEnabled == false)
            {
                server.RemindersEnabled = true;
            }

            await ReplyAsync($"Toggled reminders to: {server.RemindersEnabled}.");

            await DatabaseServers.EditServerInfo(server.ServerId, "reminders_enabled", server.RemindersEnabled);
        }