hypherionmc / sdlink

A simple to use Minecraft to Discord Chat linker with Whitelisting
MIT License
23 stars 7 forks source link

This mod is pissing me off...... #94

Closed Typhewn closed 11 months ago

Typhewn commented 11 months ago

Keeps saying the freaking bot token isnt there when i'm looking straight at it. i even put it on there to be listed 2x and it STILL is doing the same thing in 1.20.2....

hypherionmc commented 11 months ago

Okay first things first.

Which mod version, and which mod loader?

Next, please share your config, but replace some random digits in your bot token to make it invalid, as well as any webhook urls that you might have.

You can replace them with Random X's. If it makes you feel any better, you can also reset the token, and leave the old one intact.

I just want to see how it's placed in the config file and where

hypherionmc commented 11 months ago

Also just for interest sake, what OS is your server running?

Typhewn commented 11 months ago

Forge48.1.0 1.20.2 i first tried using this config and it kept crashing my server. so i copied the version 23 one and it got me a little further but then it kept saying that about my token.

General Mod Config

[general]

Should the mod be enabled or not

enabled = true
#Enable Additional Logging. Used for Fault Finding. WARNING: CAUSES LOG SPAM!
debugging = false
#Internal version control. DO NOT TOUCH!
configVersion = 13

Config specific to the discord bot

[botConfig]

The token of the Discord Bot to use. This will be encrypted on first load. See https://sdlink.fdd-docs.com/initial-setup/ to find this

botToken = "X"
#How often the Bot Status will update on Discord (in Seconds). Set to 0 to disable
statusUpdateInterval = 30

#Control what the Discord Bot will display as it's status message
[botConfig.botStatus]
    #Do not add Playing. A status to display on the bot. You can use %players% and %maxplayers% to show the number of players on the server
    status = "Enjoying Minecraft with %players%/%maxplayers% players"
    #The type of the status displayed on the bot. Valid entries are: PLAYING, STREAMING, WATCHING, LISTENING, CUSTOM_STATUS
    botStatusType = "STREAMING"
    #The URL that will be used when the "botStatusType" is set to "STREAMING", required to display as "streaming".
    botStatusStreamingURL = "https://www.twitch.tv/typhewn2x"

#Define how the bot should handle channel topic updates on the chat channel
[botConfig.topicUpdates]
    #Should the bot update the topic of your chat channel automatically every 6 Minutes
    doTopicUpdates = true
    #A topic for the Chat Relay channel. You can use %player%, %maxplayers%, %uptime% or just leave it empty.
    channelTopic = "Playing Minecraft with %players%/%maxplayers% people | Uptime: %uptime%"

#Configure the in-game Discord Invite command
[botConfig.invite]
    #If this is defined, it will enable the in-game Discord command
    inviteLink = "https://discord.gg/KVkTExWpHs"
    #The message to show when someone uses /discord command. You can use %inviteurl%
    inviteMessage = "Hey, check out our discord server here -> %inviteurl%"

Config relating to the discord channels and webhooks to use with the mod

[channelsAndWebhooks]

A DIRECT link to an image to use as the avatar for server messages. Also used for embeds

serverAvatar = ""
#The name to display for Server messages when using Webhooks
serverName = "Utopia Server"

#Config relating to the discord channels to use with the mod
[channelsAndWebhooks.channels]
    #REQUIRED! The ID of the channel to post in and relay messages from. This is still needed, even in webhook mode
    chatChannelID = "X"
    #If this ID is set, event messages will be posted in this channel instead of the chat channel
    eventsChannelID = "X"
    #If this ID is set, console messages sent after the bot started will be relayed here
    consoleChannelID = "X"

#Config relating to the discord Webhooks to use with the mod
[channelsAndWebhooks.webhooks]
    #Prefer Webhook Messages over Standard Bot Messages
    enabled = false
    #The URL of the channel webhook to use for Chat Messages. Will be encrypted on first run
    chatWebhook = ""
    #The URL of the channel webhook to use for Server Messages. Will be encrypted on first run
    eventsWebhook = ""
    #The URL of the channel webhook to use for Console Messages. DOES NOT WORK FOR CONSOLE RELAY! Will be encrypted on first run
    consoleWebhook = ""

Configure which types of messages are delivered to Minecraft/Discord

[chat]

Use linked account names in Discord/Minecraft messages, instead of the default ones

useLinkedNames = true
#Convert Discord to MC, and MC to Discord Formatting
formatting = true
#Should console messages be sent to the Console Channel
sendConsoleMessages = true
#The type of image to use as the player icon in messages. Valid entries are: AVATAR, HEAD, BODY, COMBO
playerAvatarType = "HEAD"
#Should messages sent with TellRaw be sent to discord as a chat? (Experimental)
relayTellRaw = true
#Should the entire command executed be relayed to discord, or only the name of the command
relayFullCommands = false
#Should messages from bots be relayed
ignoreBots = true
#Should SERVER STARTING messages be shown
serverStarting = true
#Should SERVER STARTED messages be shown
serverStarted = true
#Should SERVER STOPPING messages be shown
serverStopping = true
#Should SERVER STOPPED messages be shown
serverStopped = true
#Should the chat be relayed
playerMessages = true
#Should Player Join messages be posted
playerJoin = true
#Should Player Leave messages be posted
playerLeave = true
#Should Advancement messages be posted
advancementMessages = true
#Should Death Announcements be posted
deathMessages = true
#Should Messages from the /say command be posted
sendSayCommand = true
#Should commands be posted to discord
broadcastCommands = true
#Commands that should not be broadcast to discord
ignoredCommands = ["particle", "login", "execute"]
#Allow mentioning discord roles, users and channels from Minecraft Chat
allowMentionsFromChat = false

Change the format in which messages are displayed

[messageFormatting]

Prefix to add to Minecraft when a message is relayed from Discord. Supports MC formatting. Use %user% for the Discord Username

mcPrefix = "§e[DC]§r %user%:"
#Server Starting Message
serverStarting = "*Server is starting...*"
#Server Started Message
serverStarted = "*Server has started. Enjoy!*"
#Server Stopping Message
serverStopping = "*Server is stopping...*"
#Server Stopped Message
serverStopped = "*Server has stopped...*"
#Player Joined Message. Use %player% to display the player name
playerJoined = "*%player% has joined the server!*"
#Player Left Message. Use %player% to display the player name
playerLeft = "*%player% has left the server!*"
#Achievement Messages. Available variables: %player%, %title%, %description%
achievements = "*%player% has made the advancement [%title%]: %description%*"
#Chat Messages. THIS DOES NOT APPLY TO EMBED OR WEBHOOK MESSAGES. Available variables: %player%, %message%
chat = "%player%: %message%"
#Death Messages. Available variables: %player%, %message%
death = "%player% %message%"
#Command Messages. Available variables: %player%, %command%
commands = "%player% **executed command**: *%command%*"

Change in which channel messages appear

[messageDestinations]

#Control where CHAT messages are delivered
[messageDestinations.chat]
    #The Channel the message will be delivered to. Valid entries are CHAT, EVENT, CONSOLE
    channel = "CHAT"
    #Should the message be sent using EMBED style messages
    useEmbed = false
    #Embed Layout to use
    embedLayout = "default"

#Control where START messages are delivered
[messageDestinations.start]
    #The Channel the message will be delivered to. Valid entries are CHAT, EVENT, CONSOLE
    channel = "CONSOLE"
    #Should the message be sent using EMBED style messages
    useEmbed = false
    #Embed Layout to use
    embedLayout = "default"

#Control where STOP messages are delivered
[messageDestinations.stop]
    #The Channel the message will be delivered to. Valid entries are CHAT, EVENT, CONSOLE
    channel = "CONSOLE"
    #Should the message be sent using EMBED style messages
    useEmbed = false
    #Embed Layout to use
    embedLayout = "default"

#Control where JOIN messages are delivered
[messageDestinations.join]
    #The Channel the message will be delivered to. Valid entries are CHAT, EVENT, CONSOLE
    channel = "CONSOLE"
    #Should the message be sent using EMBED style messages
    useEmbed = false
    #Embed Layout to use
    embedLayout = "default"

#Control where LEAVE messages are delivered
[messageDestinations.leave]
    #The Channel the message will be delivered to. Valid entries are CHAT, EVENT, CONSOLE
    channel = "CONSOLE"
    #Should the message be sent using EMBED style messages
    useEmbed = false
    #Embed Layout to use
    embedLayout = "default"

#Control where ADVANCEMENT messages are delivered
[messageDestinations.advancements]
    #The Channel the message will be delivered to. Valid entries are CHAT, EVENT, CONSOLE
    channel = "EVENT"
    #Should the message be sent using EMBED style messages
    useEmbed = false
    #Embed Layout to use
    embedLayout = "default"

#Control where DEATH messages are delivered
[messageDestinations.death]
    #The Channel the message will be delivered to. Valid entries are CHAT, EVENT, CONSOLE
    channel = "EVENT"
    #Should the message be sent using EMBED style messages
    useEmbed = false
    #Embed Layout to use
    embedLayout = "default"

#Control where COMMAND messages are delivered
[messageDestinations.commands]
    #The Channel the message will be delivered to. Valid entries are CHAT, EVENT, CONSOLE
    channel = "EVENT"
    #Should the message be sent using EMBED style messages
    useEmbed = false
    #Embed Layout to use
    embedLayout = "default"

#Control where messages that match none of the above are delivered
[messageDestinations.custom]
    #The Channel the message will be delivered to. Valid entries are CHAT, EVENT, CONSOLE
    channel = "EVENT"
    #Should the message be sent using EMBED style messages
    useEmbed = false
    #Embed Layout to use
    embedLayout = "default"

Manage access to your server, similar to whitelisting

[accessControl]

Enable Access Control

enabled = false
#Does the player need to be a member of your discord to join
requireDiscordMembership = false
#Optional: The player requires any of these roles to be able to join your server
requiredRoles = []
#Optional: Players with these roles will never be allowed access to your server
deniedRoles = []
#Optional: Role name or ID to assign to verified player accounts
verifiedRole = ""
#Should players with verified accounts, be banned from Minecraft if they get banned on discord
banPlayerOnDiscordBan = false
#Should members with verified accounts, be banned from discord when they are banned on Minecraft
banMemberOnMinecraftBan = false

#Configure messages shown to players when they don't meet verification requirements
[accessControl.verificationMessages]
    #The message shown to players that are not verified
    accountVerification = "This server requires account verification. Your verification code is: {code}. Please visit our discord server for instructions on how to verify your account."
    #Message to show to players that are not a member of your discord
    nonMember = "Sorry, you need to be a member of our discord server to join this server"
    #Message to show when player doesn't have one of the required roles. Use {roles} to display the names of configured roles
    requireRoles = "Sorry, but you require any of the following roles: {roles}"
    #Message to show when player has a role from the deniedRoles list
    roleDenied = "Sorry, but you are not allowed to access this server."

Execute Minecraft commands in Discord

[minecraftCommands]

Allow executing Minecraft commands from Discord

enabled = true
#Command Prefix. For example ?weather clear
prefix = "?"
#List of command permissions
permissions = [give <user> lightmanscurrency:coinblock_netherite 3, ]

Configure messages that will be ignored when relaying to discord

[ignoredMessages]

Filter certain types of messages from being relayed back to discord

ignoredMessages = true
#List of entries to process
entries = []
#Ignore messages sent from certain threads
ignoredThreads = []
Typhewn commented 11 months ago

Sorry if i sound pissed but i value my time especially now that im paralyzed and i just spent 3hrs getting NOWHERE

hypherionmc commented 11 months ago

No problem, I understand the frustration.

So this config that you shared, is for the V3 beta of this mod, which does currently have issues with Player Join and Advancements on 1.20.2. Both of which have work arounds.

That aside, if you are indeed using V3 beta, this config would be invalid because of permissions = [give lightmanscurrency:coinblock_netherite 3, ] causing the config to fail to load, which would result in the "Missing or invalid" bot token error

Typhewn commented 11 months ago

Am i supposed to only put permission integer in permissions areas?

Typhewn commented 11 months ago

I've finally beat pass the wall with your help but the console just gave me a massive error with me missing all permissions

hypherionmc commented 11 months ago

For the commands, this should help you with what you need: https://sdlinkbeta.fdd-docs.com/features/linked-commands/

The permissions you can just fix per channel, or if you are one of those like one of our staff members, just give the bot admin perms lol.

But on a more serious note, this should explain the permissions as well: https://sdlinkbeta.fdd-docs.com/installation/sdlink-perms/

You can just set them on the channels that you configured

hypherionmc commented 11 months ago

Also the work arounds I mentioned:

For player join, disable allowMentionsFromChat (change it to false), and for advancements, disable advancementMessages.

There is a pending update to fix both those. Just awaiting testing feedback

hypherionmc commented 11 months ago

Fixed in 3.0.1 Beta