Exemplo n.º 1
0
        public void Start()
        {
            PollModule module = context.GetModule <PollModule>();

            module.PollCreated   += OnPollAdded;
            module.PollRemoved   += OnPollRemoved;
            module.PollCleared   += OnPollCleared;
            module.OptionAdded   += OnOptionAdded;
            module.OptionRemoved += OnOptionRemoved;

            module.VoteAdded   += OnVoteAdded;
            module.VoteRemoved += OnVoteRemoved;

            polls.Clear();
            foreach (Poll poll in module.GetPolls())
            {
                polls.Add(new PollEditor(poll));
            }

            context.GetModuleByKey <IMainWindow>(ModuleKeys.MainWindow).AddMenuItem("Manage.Polls", (sender, args) => Show());
        }
        public override void ExecuteCommand(IChatChannel channel, StreamCommand command)
        {
            string polllist = string.Join(", ", module.GetPolls().Select(p => p.Name));

            SendMessage(channel, command.User, $"Currently running polls: {polllist}");
        }