public async Task SetReportRole(SocketRole role) { ReportSettings settings = Context.Guild.LoadFromFile <ReportSettings>(); if (settings.requiredRole == role.Id) { ReplyAsync("Reporting is already set to that role"); } else { settings.requiredRole = role.Id; settings.SaveToFile(); ReplyAsync($"Reporting now requires {role.Name} role"); } }
public async Task SetReportChannel() { try { ReportSettings settings = Context.Guild.LoadFromFile <ReportSettings>(true); if (settings.channelID == Context.Channel.Id) { ReplyAsync("Reporting is already set to log here"); } else { settings.channelID = Context.Channel.Id; settings.SaveToFile(); ReplyAsync("Reporting is now set to this channel"); } } catch (Exception e) { ReplyAsync("Error: " + e); } }
public async Task SetReportRole(string value) { value.ToLower(); if (!(value == "null" || value == "none")) { await ReplyAsync("Invalid role"); return; } ReportSettings settings = Context.Guild.LoadFromFile <ReportSettings>(); if (settings.requiredRole == null) { ReplyAsync("Reporting is already set to not need a role"); } else { settings.requiredRole = null; settings.SaveToFile(); ReplyAsync($"Reporting now doesn't require a role"); } }