smogon / Porygon-Z

The Bot for the Official Smogon Discord (WIP)
https://discord.gg/smogon
MIT License
13 stars 6 forks source link

Handle News Channel Messages better #18

Closed HoeenCoder closed 4 years ago

HoeenCoder commented 4 years ago

Discord allows users with webhook permissions to subscribe to new channels from other servers. Currently when Porygon-Z sees a news channel subscription message, its apparently treating it as a user and inserting information about it into the postgres database.

A sample of one of these messages from the server where it originate can be seen here: image

users table: image userlist table: image

Interestingly, there is no entry for the lines table. In addition I'm unsure what this ID is exactly as its not the server or channel in question. Regardless this is not considered to be a user by discord and could cause issues so steps should be taken to identify and not insert data from these new subscriptions into the database.

Also on a side note manually setup webhooks such as the github webhook in the official smogon development discord don't appear to be getting inserted into the database atm.

HoeenCoder commented 4 years ago

Possibly fixed in upcoming commit. Not easy to test due to the nature.

HoeenCoder commented 4 years ago

I'll be testing this to confirm its fixed tomorrow since the opportunity will be there.

HoeenCoder commented 4 years ago

Confirmed fixed.