goopypanther / saucebot-discord

17 stars 13 forks source link

Figure out a different way to login to pixiv? #18

Closed flleeppyy closed 3 years ago

flleeppyy commented 3 years ago

So I have quite a lot of pixiv links being sent in my discord server, and JUST TODAY, they decide to spam my email with all the login notifications.

Screenshot_20201103-013234_Email.jpg

155 emails. And the math checks out, there has been 155 pixiv links sent in my discord since i added the bot.

Could you PLEASE FOR THE LOVE OF GOD, figure out a better way to do this? I would help out my self but i absolutely suck at, and hate python

goopypanther commented 3 years ago

As far as I can tell there's no way to stop pixiv from sending you an email every time you log in. The bot only logs in once when started and only one email is sent. Posting a pixiv link causes the oauth token to refresh but it doesn't result in an email. (I have an instance running in a couple thousand servers and it only emails me once on startup)

If you're getting hundreds of emails one minute apart its probably because the bot's exiting and your computer is relaunching the service. This usually happens if discord's servers are messed up. Discordpy normally tries to recover but sometimes it breaks the asyncio scheduler or something and the whole thing dies.

I can try moving the pixiv API setup after the discord login is successful, hopefully its as simple as that.

flleeppyy commented 3 years ago

I figured out why, I was providing an invalid discord token. i have no idea how or why, cause i never regenerated the token.