-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP (but working) Discord implementation #95
base: master
Are you sure you want to change the base?
Conversation
I think I've taken this as far as I can without collaboration from you @benrick All basic functionality is implemented so it's at the point where it wants to branch out into all sorts of places in the bot framework to make changes that I don't feel comfortable making decisions about. |
Yep. I'll pull this in and help work on it. |
Awesome |
8207c92
to
071f163
Compare
I went ahead and rebased this branch |
What's the status of this PR? Is there work here I can pick up? |
The status is all laid out in the wall of text above. There's a lot of questions about how the core bot framework should be changed to accommodate the needs of the Discord side. The biggest "issue" is that the core framework was developed on stream with a focus on working with Twitch. I haven't actually ran this in a while but it was connecting to discord and able to process commands as it should. If you want to contribute to this pull request though, you can make a fork off of my fork and send me pull requests and I can get them merged in to this pull request. I've been waiting for @benrick to either chime in with thoughts on the issues I laid out or to just jump in and start resolving some of them. But Discord just isn't a priority right now |
Depends on PR #94
Fixes #14
Status of the discord implementation is as follows:
Feedback and ideas are desired and most welcome!
Discord Library
Using Discord.NET as the discord library
Discord client doesn't actually disconnect from discord when you tell it to. This is a known bug and doesn't really cause any problems other than potential confusion for 30 seconds or whatever before discord times out the bot and removes it from the server.
Chat Related
I'm not seeing an obvious way to see if a particularSocketMessage
came from a DM or from a text channel in the guild. The only differentiating thing I can see is if it's in a guild text channel the user is of typeSocketGuildUser
and if it's a DM they are aSocketGlobalUser
which is unfortunately? an internal type.Currently only supports writing messages to one specific channel defined in the configuration
Discord supports markdown so for now I am wrapping all sent messages in backticks as hangman wouldn't show you all the asterisks otherwise!
Currently whenever the bot logs in to Discord it sends the
Hello and welcome! I hope you're enjoying the steam!...
message to the text channel it's set to talk to. It really shouldn't.I think
IChatClient SendMessage
needs to be overhauled and take more than just plain old stringI think the command parser is robust enough but I'm not certain.
!test slightly "more complicated" --argu"m"e'nts=hello "another quoted string?!"
It breaks down to{slightly, more complicated, --argu"m"e'nts=hello, another quoted string}
Misc. Infrastructure
There should be a way to link a Discord user with a user from a streaming platform so their currency is available to them in Discord
With the way
CurrencyGenerator
is currently implemented it will begin watching the user if they join Discord or Twitch and will remove the user if they leave either of them. I'm not sure you should even be generating currency for users in Discord at all.There should be a way to hook Discord into a streaming platform so the bot can be notified when there is a new subscriber and adjust their Roles in Discord if necessary
I'm not a huge fan of having to do
if (discordUser.RoleIds.Any(role => role == settings.DiscordStreamerRoleId))
for each and every role when determining what UserRole to assign a ChatUserJsonConverter
should be made so we can define a dictionary in the configuration with UserRole as the key and the DiscordRoleId as the value. Only issue with that is it becomes harder to maintain if you ever rename or remove a UserRole