Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
much better
  • Loading branch information
N1Ran committed Jan 20, 2019
commit df0f3cfaa6e613655e7cf49cffcdda7ae2400eae
14 changes: 4 additions & 10 deletions Essentials/Commands/VotingModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,15 @@ public void Vote(string name)
return;
}

if (command == null)
if (command == null || !command.Votable)
{
Context.Respond($"Couldn't find an auto command with the name {name}");
Context.Respond($"Couldn't find any votable command with the name '{name}'");
return;
}

if (Context.Player == null)
return;

if (!command.Votable)
{
Context.Respond($"{name} is not set for voting.");
return;
}
var steamid = Context.Player.SteamUserId;

// Rexxar's spam blocker
Expand Down Expand Up @@ -102,9 +97,8 @@ public void Vote(string name)
_voteInProgress = true;
if (_voteDuration.TotalSeconds > 10)
{
Context.Torch.CurrentSession?.Managers?.GetManager<IChatManagerServer>()?.SendMessageAsSelf($"Voting started for {name}. " +
$"use '!yes' to vote and '!no' to retract your vote " +
$"voting ends in {_voteDuration.Minutes:N0} minutes : {_voteDuration.Seconds:N0} seconds. ");
Context.Torch.CurrentSession?.Managers?.GetManager<IChatManagerServer>()?.SendMessageAsSelf($"Voting started for {name} by {Context.Player.DisplayName}. " +
$"Use '!yes' to vote and '!no' to retract your vote");
}

//vote countdown
Expand Down