Difference between revisions of "Manual:Discord"
(Created page with "= Connecting the MUD server to Discord = == Creating a Discord Robot == First you need to create a "robot" on Discord that will relay messages between your Discord server an...") |
|||
Line 23: | Line 23: | ||
Check their respective log files to check for any connection problems. If you used the scripts | Check their respective log files to check for any connection problems. If you used the scripts | ||
to run it, then look in '''$VME_ROOT/log/muddiscord.log''' and '''$VME_ROOT/log/dispatcher.log''' | to run it, then look in '''$VME_ROOT/log/muddiscord.log''' and '''$VME_ROOT/log/dispatcher.log''' | ||
+ | |||
+ | |||
+ | === Example of Dispatcher Log File === | ||
+ | |||
+ | *** dispatcher.py started by val at Mon May 20 10:41:39 UTC 2024. *** | ||
+ | 10:41:39 up 0 min, 0 users, load average: 1.04, 0.22, 0.07 | ||
+ | Opening connection to named pipe: pipeDiscord | ||
+ | Reusing pipe pipeDiscord | ||
+ | Pipe has been accessed pipeDiscord | ||
+ | Nobody is listening to pipeDiscord. Pausing and retrying | ||
+ | Nobody is listening to pipeDiscord. Pausing and retrying | ||
+ | Pipe has been opened as write-only non-blocking: pipeDiscord | ||
+ | Opening blocking read connection to MUD : pipeDispatcher | ||
+ | Reusing pipe pipeDispatcher | ||
+ | Pipe has been accessed pipeDispatcher | ||
+ | MUD said: [discord msg #build **BOOTING** Valhalla MUD. | ||
+ | ] | ||
+ | Relaying message to Discord: <discord> msg #build **BOOTING** Valhalla MUD. | ||
+ | |||
+ | Message of 47 bytes sent, wrote 47 bytes | ||
+ | Ready for next line in fifopipe | ||
+ | MUD said: [discord who Finndo && | ||
+ | ] | ||
+ | Relaying message to Discord: <discord> who Finndo && | ||
+ | |||
+ | Message of 24 bytes sent, wrote 24 bytes | ||
+ | Ready for next line in fifopipe | ||
+ | MUD said: [discord who Osric &&Finndo && | ||
+ | ] | ||
+ | |||
+ | === Example of muddiscord log file === | ||
+ | |||
+ | *** muddiscord.py started by val at Mon May 20 10:41:39 UTC 2024. *** | ||
+ | 10:41:39 up 0 min, 0 users, load average: 1.04, 0.22, 0.07 | ||
+ | Discord Bot Token loaded, logging in | ||
+ | Opening named pipe WR ONLY: pipeMUD | ||
+ | Reusing pipe pipeMUD | ||
+ | Pipe has been accessed pipeMUD | ||
+ | Nobody is listening to pipeMUD. Pausing and retrying | ||
+ | Pipe has been opened: pipeMUD | ||
+ | Opening RO connection to named pipe: pipeDiscord | ||
+ | Reusing pipe pipeDiscord | ||
+ | Pipe has been accessed pipeDiscord | ||
+ | Pipe has been opened: pipeDiscord | ||
+ | pipeListener running | ||
+ | Resolving channel name = mud | ||
+ | Resolved new channel mud | ||
+ | Resolving channel name = mudstatus | ||
+ | Resolved new channel mudstatus | ||
+ | Resolving channel name = builder | ||
+ | Resolved new channel builder | ||
+ | Getting my whomsg to pin and alter | ||
+ | Resolving channel name = mudstatus | ||
+ | Logged in to Discord as: MUDDiscord 797208102654443560 | ||
+ | ------ | ||
+ | Got whomsg and ready to begin | ||
+ | Debug: Got line: [ <discord> msg #build **BOOTING** Valhalla MUD. | ||
+ | ] | ||
+ | Line = [<discord> msg #build **BOOTING** Valhalla MUD.] | ||
+ | words[2][1:] = build | ||
+ | Resolving channel name = build | ||
+ | Msg Line = [<discord> msg #build **BOOTING** Valhalla MUD.] | ||
+ | Partition = **BOOTING** Valhalla MUD. | ||
+ | Send as message id = 1242064821994786857 | ||
+ | Debug: Got line: [ <discord> who Finndo && | ||
+ | ] | ||
+ | Line = [<discord> who Finndo &&] | ||
+ | Resolving channel name = mud | ||
+ | WHO update: | ||
+ | [Finndo | ||
+ | ] | ||
+ | editWho: Sending | ||
+ | editWho: Done | ||
+ | Who update done. | ||
+ | Debug: Got line: [ <discord> who Osric &&Finndo && | ||
+ | ] | ||
+ | Line = [<discord> who Osric &&Finndo &&] | ||
+ | Resolving channel name = mud | ||
+ | WHO update: | ||
+ | [Osric | ||
+ | Finndo | ||
+ | ] |
Latest revision as of 07:38, 18 September 2024
Contents
Connecting the MUD server to Discord
Creating a Discord Robot
First you need to create a "robot" on Discord that will relay messages between your Discord server and the MUD.
... Maybe a link to Discord or some help article ...
The end-result is token that looks something like Mzk3NjA4QTAyNjU0NDLzNTYw.X_jH5w.aQVUDfJvugh3HTOQzfcPnp6_36E
Configuration
In the folder vme/bin/ create a text file called discord.token and put the Discord token value in this file.
Running the VME Discord programs
The two Python 3 scripts "dispatcher.py" and "muddiscord.py" must be running on your server. If you just edited the token you will have to restart the scripts.
If you start the VME using the "startvme.sh" script then it will take care of also launching these two programs.
Check their respective log files to check for any connection problems. If you used the scripts to run it, then look in $VME_ROOT/log/muddiscord.log and $VME_ROOT/log/dispatcher.log
Example of Dispatcher Log File
*** dispatcher.py started by val at Mon May 20 10:41:39 UTC 2024. *** 10:41:39 up 0 min, 0 users, load average: 1.04, 0.22, 0.07 Opening connection to named pipe: pipeDiscord Reusing pipe pipeDiscord Pipe has been accessed pipeDiscord Nobody is listening to pipeDiscord. Pausing and retrying Nobody is listening to pipeDiscord. Pausing and retrying Pipe has been opened as write-only non-blocking: pipeDiscord Opening blocking read connection to MUD : pipeDispatcher Reusing pipe pipeDispatcher Pipe has been accessed pipeDispatcher MUD said: [discord msg #build **BOOTING** Valhalla MUD. ] Relaying message to Discord: <discord> msg #build **BOOTING** Valhalla MUD. Message of 47 bytes sent, wrote 47 bytes Ready for next line in fifopipe MUD said: [discord who Finndo && ] Relaying message to Discord: <discord> who Finndo && Message of 24 bytes sent, wrote 24 bytes Ready for next line in fifopipe MUD said: [discord who Osric &&Finndo && ]
Example of muddiscord log file
*** muddiscord.py started by val at Mon May 20 10:41:39 UTC 2024. *** 10:41:39 up 0 min, 0 users, load average: 1.04, 0.22, 0.07 Discord Bot Token loaded, logging in Opening named pipe WR ONLY: pipeMUD Reusing pipe pipeMUD Pipe has been accessed pipeMUD Nobody is listening to pipeMUD. Pausing and retrying Pipe has been opened: pipeMUD Opening RO connection to named pipe: pipeDiscord Reusing pipe pipeDiscord Pipe has been accessed pipeDiscord Pipe has been opened: pipeDiscord pipeListener running Resolving channel name = mud Resolved new channel mud Resolving channel name = mudstatus Resolved new channel mudstatus Resolving channel name = builder Resolved new channel builder Getting my whomsg to pin and alter Resolving channel name = mudstatus Logged in to Discord as: MUDDiscord 797208102654443560 ------ Got whomsg and ready to begin Debug: Got line: [ <discord> msg #build **BOOTING** Valhalla MUD. ] Line = [<discord> msg #build **BOOTING** Valhalla MUD.] words[2][1:] = build Resolving channel name = build Msg Line = [<discord> msg #build **BOOTING** Valhalla MUD.] Partition = **BOOTING** Valhalla MUD. Send as message id = 1242064821994786857 Debug: Got line: [ <discord> who Finndo && ] Line = [<discord> who Finndo &&] Resolving channel name = mud WHO update: [Finndo ] editWho: Sending editWho: Done Who update done. Debug: Got line: [ <discord> who Osric &&Finndo && ] Line = [<discord> who Osric &&Finndo &&] Resolving channel name = mud WHO update: [Osric Finndo ]