Staxel
Недостатньо оцінок
Staxelcord: Discord Integration for Staxel
   
Нагородити
До улюбленого
В улюблених
Прибрати
New Features, Other
Позначки: Discord, Chat, Integration
Розмір файлу
Додано
2.099 MB
2 трав. 2022 о 9:18

Підпишіться, аби завантажити
Staxelcord: Discord Integration for Staxel

Опис
Staxelcord is a server-side multiplayer mod that allows server hosts to link in-game chat with a Discord channel of their choosing. Bot commands are also available, allowing users to view server details.



Current Features
  • Send message from Staxel to Discord and vice-versa
    • Supports in-game display of user role color
  • Use commands to view server details
    • online will list all players currently on the server
    • mods will list all mods installed, complete with a link to their respective Workshop page
    • info will provide details on the server's current state, as well as the world's generation

Planned Features
This is just the beginning for Staxelcord. There's a lot more planned! Take a look.
  • Migrate message commands to slash commands before deprecation
  • Migrate player messages to webhook messages before deprecation
  • Somehow create an avatar API so player avatars are shared?
  • Markdown parsing and text transforms to seamlessly bridge both chats
  • Parse and resolve channel, role, and user mentions
  • Send message on server events (start, stop)
  • Send message on player events (join, leave, achievement, quest)
  • Allow server host to toggle events and customize message format
  • Perhaps add a slash command to mute, kick, and ban a user



Staxelcord is a Moonbow-dependent mod. It will not function without the library installed.

This mod makes use of Moonbow's messaging interface to be able to receive message events, as well as send messages to all players on the server. Moonbow must be installed in order for Staxelcord to make use of these utilities.

You can download Moonbow from its Steam Workshop listing.



Setting up Staxelcord

1. Creating a bot user

Log in to the Discord Developer Portal[discord.com], and click on New Application in the top right.

Give your application a name, select a team if prompted, and click on Create to get started.

On the resulting application page, you may add an app icon. Though this is separate from the avatar the bot will use, the app icon will be set as the default avatar when creating a bot.

To create a bot, click on Bot from the sidebar on the left, and Add Bot from the resulting bot page. This will prompt a warning that creating a bot is irreversible, which can be ignored as the bot is the sole reason we're even here.

Copy your bot's token and keep it safe. Anyone with the token can gain control of your bot and cause damage to any server it's been invited to. For now, keep the token in a digital sticky note or temporary notepad. You'll need it for a later step.

Beneath the Privileged Gateway Intents section of the bot page, enable Message Content Intent. This step will not be required in a future Staxelcord update, but for the sake of simplicity, it's required in its initial release.

Congratulations! Your bot user is complete and ready to join your server.

2. Inviting the bot to your server

If you know how to use the OAuth2 URL Generator, grant the Read Messages/View Channels, Send Messages, and Embed Links permissions for the bot scope.

If you'd rather just copy an existing link, though, you're in luck.
Head over to the General Information tab on the left sidebar, and copy your Application ID. Now, paste it at the end of this authorization link, and invite your bot.
Don't see your server? You require Manage Server role permissions to invite bots.

Your bot is now on the server and awaiting orders! You may now close the Discord Developer Portal.

3. Retrieving your bridged channel's ID

If you haven't already created a channel for Staxel chat, then do so now. Make sure your bot has permissions to view the channel and send messages in it.

If you don't have Developer Mode enabled, then toggle it by opening User Settings, clicking on Advanced under App Settings, and flipping the switch.

Right-click on the channel for Staxel chat and select Copy ID. Keep this alongside your bot token.

4. Configuring Staxelcord

Launch Staxel and open the world you'd like to enable Staxelcord on. Once you load in, back out to the main menu. Staxelcord has now generated an example configuration file for you.

Head to your world's save folder. You can do this by opening Staxel's page in your Steam library, clicking on the cogwheel to the right of the game banner, hovering over Manage, and clicking on Browse local files. From there, open the LocalContent folder, and enter your world's save folder.

You'll notice a Mods folder inside, and a Staxelcord folder inside that one. Open them until you're greeted with an example file named config.example.json. Create a copy of the file and rename it to config.json. Open the file with Notepad or your preferred text editor, and replace DISCORD_BOT_TOKEN with your bot's token, BRIDGED_CHANNEL_ID with the channel ID you copied earlier, and BOT_PREFIX with whatever prefix you'd like the bot to use. If the line with "prefix" isn't provided, s! is used by default.

Save the file, load back into the world, and you're done! If you run into any issues, do let me know, and I'll do my best to help you resolve them. Do enjoy!
Коментарів: 4
VinnyTheBunny 26 черв. 2024 о 12:46 
I'd really appreciate it, but zero pressure! take your time
wowi  [автор] 26 черв. 2024 о 12:43 
Ah, yeah, I haven't updated the mod in.. years, haha. Would you like me to try to fix it? I could give it a shot. :staxelCow:
VinnyTheBunny 26 черв. 2024 о 4:30 
as of 06/26/24 this mod still gives errors
wowi  [автор] 6 лип. 2022 о 21:09 
Oh gosh, people are actually using this? It needs a complete rework, 'cause the code is garbage, haha. Guess that's something to work on. 😅