public async Task SetRule(int id, [Remainder] string contents) { if (_ruleTable.Has(id)) { _ruleTable.Set(id, contents); await ReplyAsync($"I updated rule { id } for you!"); } else { _ruleTable.Add(id, contents); await ReplyAsync($"I created rule { id } for you!"); } }
public async Task SetRule(int id, [Remainder] string contents) { (Context.User as IGuildUser).EnsureStaff(); if (_ruleTable.Has(id)) { _ruleTable.Set(id, contents); await ReplyAsync("Rule updated."); } else { await ReplyAsync("Invalid rule ID."); } await UpdateOriginRuleMessage(Context.Guild); }