using Plus.Communication.Packets.Outgoing.Rooms.Notifications;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Plus.HabboHotel.Rooms.Chat.Commands.User
{
    class StartQuickPollCommand : IChatCommand
    {
        public string PermissionRequired
        {
            get { return "command_start_quick_poll"; }
        }

        public string Parameters
        {
            get { return "%question% %time%"; }
        }

        public string Description
        {
            get { return "Lancé un vote.!"; }
        }

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (!Room.CheckRights(Session, false, true))
                return;
            if (Params.Length < 2)
            {
                Session.SendMessage(new BubbleNotificationComposer("Oops, tu dois ajouter un message", "notif"));
                return;
            }
            var question = CommandManager.MergeParams(Params, 1);
            var duration = 100000; // old 1000000


            var Poll = Room.GenerateQPoll(duration, question);
            Room.QuickPoll.Start();
            Session.SendMessage(new BubbleNotificationComposer("Le vote est lancé!", "notif"));
        }
    }
}