Ok you are gambling just for fun, your friends and neighbors knows that and a friend invited you to his party to be one of the candidates as a councilor and campaign will start in 6 months, now, of course, you need to have a good reputation, will you stop gambling just to have a good image this coming campaign
Are you talking about online gambling or the actual one in casino? if it is the actual one, then you really need to stop for the sake of your career as a politician, and of course for you to get the hearts of the people in your town.
and how will you defend yourself if accused as a gambler.
Denying it would just make thing worst, especially if they have evidence that you are really playing gambling before, what you need to do is to confess the truth and make a promise to the public that you'll change for good, just to clean your mess. It is more better if you're going to win without any secrets, even if you lose, at least you'll going to have your time to do what you promised and run again as a candidate for councilor next election.