public string RemoveRequest(int index) { string path = Data.FILE_PATH + Data.REQUEST_FILE; List <string> existingRequests = Data.GetContainers <string>(path); string request = existingRequests[index]; if (existingRequests != null) { Data.RemoveContainer(request, path); } index++; //So the number matches the list, starting at 1 again. return("The request at the `" + index + Data.GetIndexEnding(index) + "` position have been denied and removed from the list.\nDenied request:\n`" + request + "`"); }
public string ApproveRequest(int index) { string path = Data.FILE_PATH + Data.REQUEST_FILE; List <string> existingRequests = Data.GetContainers <string>(path); string request = existingRequests[index]; // Put the request up for voting RestUserMessage m = ((SocketTextChannel)Context.Guild.GetChannel(Data.CHANNEL_ID_REQUEST_VOTING)).SendMessageAsync(request).GetAwaiter().GetResult(); m.AddReactionAsync(new Emoji("đź‘Ť")).GetAwaiter().GetResult(); m.AddReactionAsync(new Emoji("đź‘Ž")).GetAwaiter().GetResult(); RemoveRequest(index); index++; //So the number matches the list, starting at 1 again. return("The request at the `" + index + Data.GetIndexEnding(index) + "` position have been approved and posted in " + ((SocketTextChannel)Context.Guild.GetChannel(Data.CHANNEL_ID_REQUEST_VOTING)).Mention + " for voting.\nApproved request:\n`" + request + "`"); }