khyperia / weechat-discord

Unmaintained! And also apparently this is against their TOS so DON'T USE THIS -- Weechat plugin for Discord support - https://weechat.org/ https://discordapp.com/
MIT License
51 stars 24 forks source link

[Help Wanted] Using buffer_autoset with weecord #29

Closed gviscardi closed 7 years ago

gviscardi commented 7 years ago

Could anyone point me in the right direction for using bufer_autoset script to set the short_name for some discord "channels" using buffer_autoset? I'm relatively new to weechat, so I'm a bit confused.

Also, is there a way to tag/ping people? I can autocomplete nicks using the acomplete script, but it doesn't actually 'tag' them so they get a ping.

And I tried to figure out how to label this as Help Wanted, but couldn't figure it out, sorry.

khyperia commented 7 years ago

I've never used buffer_autoset, but you probably want something like /autoset add weecord.<server_id>.<channel_id> short_name something. However, I would highly recommend using weecord's built-in renaming mechanism if you want to set a custom name: /set plugins.var.weecord.rename.<id> your_name, where is any ID: server ID, channel ID, user ID, etc., which will override any name given by Discord's API.

For pinging people, you need to use Discord's pinging syntax: @the_user, with an at-sign. A list of known "names" that will be completed into mentions can be listed with /discord debug replace - Discord has special syntax for "tagging" people, you don't just type out their name, so weechat-discord does that conversion for you (with those replacements). (The special syntax looks like <@12345>, visible with debug replace). That list is also handy for finding the IDs of channels, users, etc.

Go ahead and close this if you have no further questions, but if you do have more questions, feel free to keep commenting!

khyperia commented 7 years ago

Actually, I'm going to close this for now, as there's no more action items for me to do. But again, if you have more questions, please re-open this issue! (note I'd appreciate if you did reopen this issue instead of creating a new issue, if you have more questions, to keep threads organized. If you would like more support, I am khyperia on freenode - other methods of contact can be found at http://khyperia.com/about.html )

gviscardi commented 7 years ago

Thank you for the insight, but I am still a bit confused. The main issue I have is what is considered the server id? Is it the full name of the discord server? Or how do I find out the actual ID of the discord server?

Again, thank you for all of your help?

EDIT: Ha, ok I just noticed your mention of using debug replace to find IDs. SO scratch this question. Thank you for everything!

khyperia commented 7 years ago

... you know, I'm not actually sure there's an easy way to find server IDs. I'm going to implement a feature that lets you look up IDs (and reverse, ID to "thing") soon, but until then, I guess one way to do it is to find the ID of the channel (with /discord debug replace), then look at your .weechat/logs directory for that ID - the logfile name is weecord.<server id>.<channel id>.weechatlog. Alternatively, run /eval -n ${name} on the buffer you're curious about - this prints out the full name (instead of short_name) in the main weechat core buffer. (the full name is weecord.<server id>.<channel id>). (Make sure to use -n, otherwise you'll send a message of the buffer name!)

Sorry about this clunkyness!

khyperia commented 7 years ago

Also, very unfortunately, Discord re-uses the server ID as the ID of the first channel created, so renaming the server will also rename the first channel. (I have... strong opinions... on how Discord does some things). Keep that in mind if you notice weird things :(