Skip to content
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

Nicknames in Textchannels #5

Open
NilsKrause opened this issue May 3, 2020 · 5 comments
Open

Nicknames in Textchannels #5

NilsKrause opened this issue May 3, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@NilsKrause
Copy link
Contributor

Just as a future note. It would be very helpfull to implement a similar feature for textchannels.
It's a bit harder for these, as you are never in only one single text channel.
Maybe we could work on a concept together to implement that feature.

My current idea is to edit the message of the user with the nickname infront of the message. Something like this:
I am registered as 'Rudolf' on the Channel 'RP' and send a message there with the content 'Hey there, long time no see!'.
It instantly gets changed by the bot to 'Rudolf: "Hey there, long time no see!"' or something of the sort.

What do you think, what are yout ideas?

@LilithTheDeveloper
Copy link
Owner

I thought about this as well, but I think due to the limitations of the Discord nickname feature this is practically impossible, as Discord automatically changes your nickname in all text channels retroactively. Meaning that varying nicknames won't really work.

@NilsKrause
Copy link
Contributor Author

Exactly, maybe I was unclear. What I mean was that the bot changes the message itself, not the name of the user as thats not possible as you described.

@LilithTheDeveloper
Copy link
Owner

LilithTheDeveloper commented May 3, 2020

Oh I see what you mean, misread it at first. I'm not sure how fast the bot can realistically react to sent messages by users, but that may be tested out, good idea!

So to summerize

User sends message: "Hello there!"
Bot edits message to: "General Kenobi: Hello there!"

What needs to be worked out, is how to organize the data structure. Currently nicknames are saved in a json file with original username, userid aswell as an array of registrations. Each registration has an voice channel ID and the corresponding nickname. Perhaps there should be an additional file that collects the same data for text channels.

@NilsKrause
Copy link
Contributor Author

Yeah exactly like that.
But you don't need to track that in a different file, you could just check if its voice channel or a textchannel and react accordingly.

The main problem is, it is possible to have multiple channels with the same name.
So it's important to make sure the user has the option so select the correct one.
Maybe that would be possible by alerting the user that there are multiple channels with the same name and that they should use the channel ID instead of the name.

But that presumes that we need the feature to add a channel by id.

@RikerTuros
Copy link
Contributor

I was messing around with manipulating text channels with this bot the other day and the only thing stopping it from collecting text channels is the voice channel check in gatherChannels(). I commented that out and the bot was storing nicknames for text channels just fine.

There is still the problem of rapid message editing. I don't know for sure but I think an async bot.on(message) should work.

@LilithTheDeveloper LilithTheDeveloper added the enhancement New feature or request label May 3, 2020
LilithTheDeveloper pushed a commit that referenced this issue May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants