Comment out unused code in Poll.cs
This commit is contained in:
parent
dbd36a62d3
commit
f4897f7f2e
1 changed files with 55 additions and 55 deletions
|
@ -62,61 +62,61 @@ namespace Geekbot.net.Commands.Utils
|
||||||
await ReplyAsync("Poll creation currently disabled");
|
await ReplyAsync("Poll creation currently disabled");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var currentPoll = GetCurrentPoll();
|
// var currentPoll = GetCurrentPoll();
|
||||||
if (currentPoll.Question != null && !currentPoll.IsFinshed)
|
// if (currentPoll.Question != null && !currentPoll.IsFinshed)
|
||||||
{
|
// {
|
||||||
await ReplyAsync("You have not finished you last poll yet. To finish it use `!poll end`");
|
// await ReplyAsync("You have not finished you last poll yet. To finish it use `!poll end`");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
var pollList = rawPollString.Split(';').ToList();
|
// var pollList = rawPollString.Split(';').ToList();
|
||||||
if (pollList.Count <= 2)
|
// if (pollList.Count <= 2)
|
||||||
{
|
// {
|
||||||
await ReplyAsync(
|
// await ReplyAsync(
|
||||||
"You need a question with atleast 2 options, a valid creation would look like this `question;option1;option2`");
|
// "You need a question with atleast 2 options, a valid creation would look like this `question;option1;option2`");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
var question = pollList[0];
|
// var question = pollList[0];
|
||||||
pollList.RemoveAt(0);
|
// pollList.RemoveAt(0);
|
||||||
|
//
|
||||||
var eb = new EmbedBuilder
|
// var eb = new EmbedBuilder
|
||||||
{
|
// {
|
||||||
Title = $"Poll by {Context.User.Username}",
|
// Title = $"Poll by {Context.User.Username}",
|
||||||
Description = question
|
// Description = question
|
||||||
};
|
// };
|
||||||
|
//
|
||||||
var options = new List<PollQuestionModel>();
|
// var options = new List<PollQuestionModel>();
|
||||||
var i = 1;
|
// var i = 1;
|
||||||
pollList.ForEach(option =>
|
// pollList.ForEach(option =>
|
||||||
{
|
// {
|
||||||
options.Add(new PollQuestionModel()
|
// options.Add(new PollQuestionModel()
|
||||||
{
|
// {
|
||||||
OptionId = i,
|
// OptionId = i,
|
||||||
OptionText = option
|
// OptionText = option
|
||||||
});
|
// });
|
||||||
eb.AddInlineField($"Option {_emojiConverter.NumberToEmoji(i)}", option);
|
// eb.AddInlineField($"Option {_emojiConverter.NumberToEmoji(i)}", option);
|
||||||
i++;
|
// i++;
|
||||||
});
|
// });
|
||||||
var pollMessage = await ReplyAsync("", false, eb.Build());
|
// var pollMessage = await ReplyAsync("", false, eb.Build());
|
||||||
|
//
|
||||||
var poll = new PollModel()
|
// var poll = new PollModel()
|
||||||
{
|
// {
|
||||||
Creator = Context.User.Id.AsLong(),
|
// Creator = Context.User.Id.AsLong(),
|
||||||
MessageId = pollMessage.Id.AsLong(),
|
// MessageId = pollMessage.Id.AsLong(),
|
||||||
IsFinshed = false,
|
// IsFinshed = false,
|
||||||
Question = question,
|
// Question = question,
|
||||||
Options = options
|
// Options = options
|
||||||
};
|
// };
|
||||||
_database.Polls.Add(poll);
|
// _database.Polls.Add(poll);
|
||||||
|
//
|
||||||
i = 1;
|
// i = 1;
|
||||||
pollList.ForEach(option =>
|
// pollList.ForEach(option =>
|
||||||
{
|
// {
|
||||||
pollMessage.AddReactionAsync(new Emoji(_emojiConverter.NumberToEmoji(i)));
|
// pollMessage.AddReactionAsync(new Emoji(_emojiConverter.NumberToEmoji(i)));
|
||||||
Task.Delay(500);
|
// Task.Delay(500);
|
||||||
i++;
|
// i++;
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue