GeekyDeaks / discord-destinybot

Discord Destiny Bot
MIT License
8 stars 3 forks source link

Remove reliance on PSN #1

Closed GeekyDeaks closed 8 years ago

GeekyDeaks commented 8 years ago

At the moment everything is geared towards PSN, with some really messy code to parse a channel for ID's. This needs to abstracted out at least one layer so we can also use XBL gamertags.

unisys12 commented 8 years ago

Working on this and have a question... It seems that the reliance, at the moment, on PSN is parsing the PSN Channel - correct? Which, I will be totally honest with you, I still don't exactly understand why the project is doing that. I don't mean that in an insulting way. I am merely stating my ignorance on the matter.

After fiddling around a bit, I have managed to get some XBL/PSN dynamics working. Not ready for a pull request yet, cause I want to get all the changes implemented and test it out. You know, see what I break first. LOL.

Slowly getting more comfortable with the code base. Sorry if it seems that it is taking me a long time. Better safe than muck up a perfectly good project.

GeekyDeaks commented 8 years ago

So.... the server has a channel in which is listed everyones PSN, the games they play and their timezone (if you take a look at #psn-dev on my test server you can see typically what it looks like). Unfortunately this was cumbersome and they started to make channels specifically for each game e.g. #ow-psn. I wanted the destiny lookup to be able to use someones discord tag and map it to their PSN, rather than they have to browse #psn, find the person they are interested in and then use the PSN on the command. With the #psn channel already containing this information, I just hacked together a quick parser. This then grew into the 'players' command which allows you to lookup all those who have registered an interest in a game and removes the need for the per-game PSN channels.

Personally, I'd prefer to have this in a database (or something similar), but the server maintainer is keen to keep the #psn channel, so for now it's going to have to stay, but I am looking at abstracting where the info comes from, so you can use a DB or a channel.

GeekyDeaks commented 8 years ago

This has been added to master