namelessmc / nameless-link Goto Github PK
View Code? Open in Web Editor NEWThe Nameless Link bot synchronizes ranks between a Discord Guild and a NamelessMC website.
Home Page: https://namelessmc.com/discord-bot-invite
License: MIT License
The Nameless Link bot synchronizes ranks between a Discord Guild and a NamelessMC website.
Home Page: https://namelessmc.com/discord-bot-invite
License: MIT License
Hello. I was trying to make a discord bot that would pull announcements from my forums category. I made a manual embed but when I tried to make it automatic I was told there was no support.
I was wondering if you could add these abilities to your API
"this bot cannot join more servers because its not verified"
An option could be added to set the bot's rich presence in the env settings, such as PLAYNG, STREAMING, etc. Etc.
And of course you can set what the bot is doing like playng on x server
In reference to https://github.com/NamelessMC/Nameless-Link/wiki/Setup
Using NamelessHosting, I set up the panel integration a few weeks ago and that continues to work fine.
I've come back today to link NamelessMC and Discord accounts, but the bot is not accepting DMs. I am the guild owner, but am not particularly skilled at this. Tried kicking the bot and re-inviting it, but that made no difference. What am I doing wrong?
Unlike normal ping commands. This checks the connection to the API Server and the Plugin (if active)
This could be achieved by either letting the plugin making a POST request directly to Nameless-Link webserver, or go through hoops to the website first before sending it to Nameless-Link (with group sync/integration on)
It should be updated on join events or through a force update command. Though I'm not technical enough to know how it would perform.
Very simple commands that only someone with a linked admin role can use (maybe a website permission or website owner only or even discord permission set)
!VerifyRoles - Verifies all the roles in the discord and syncs them with the website (Pulls from the website to update) {Maybe even update plugin roles with website.}
!VerifyUsernames - Similar to !UpdateUsername (I beleive) in that it updates all users in the discord to ensure their names are the same as their Minecraft Account Usernames.
!Ping - Unlike normal ping commands. This checks the connection to the API Server and the Plugin (if active)
I've set up Group Sync according to the wiki. Role ID is set up and the StaffCP shows integration is enabled and the bot successfully linked, but this happens:
@everyone
role.!verify
is successful, but is not promoted to Member
role.Am I mistaken that User123 should be promoted to Member
after verification (wiki says "roles are synced in both directions")? Or am I having to wait for #102 ? API rules:
Deleting wiki and using wiki.js
Note: only making this possible when v2 pre13 releases and the pull request is merged
NamelessMC 2.0.0-pr9 installed on subdomain, i.e. nameless.example.org
!apiurl 801111111111111111 https://nameless.example.org/index.php?route=/api/v2/or6bUquKxjAAAAtkDIdWl2VXCsJgAAAA
DM'ing the command above to the Nameless-Link bot returns the following error:
java.io.FileNotFoundException: https://example.org/index.php?route=/api/v2/or6bUquKxjAAAAtkDIdWl2VXCsJgAAAA/info
So it appears the subdomain nameless.
is being ignored and I can't hook to the API. Thoughts?
Exception in thread "pool-3-thread-20" java.lang.NullPointerException: Cannot invoke "java.io.InputStream.read(byte[])" because "is" is null
at com.namelessmc.java_api.RequestHandler.getBytesFromInputStream(RequestHandler.java:183)
at com.namelessmc.java_api.RequestHandler.makeConnection(RequestHandler.java:135)
at com.namelessmc.java_api.RequestHandler.post(RequestHandler.java:52)
at com.namelessmc.java_api.NamelessAPI.setDiscordBotUrl(NamelessAPI.java:412)
at com.namelessmc.bot.Main.lambda$main$0(Main.java:246)
at com.namelessmc.bot.Main$$Lambda$266/0x00000000c62851b8.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
"/configure username_sync state:true" threw this error
[pool-1-thread-1] INFO com.namelessmc.bot.commands.ConfigureCommand - Subcommand: username_sync
[pool-1-thread-1] ERROR com.namelessmc.bot.commands.ConfigureCommand - storage backend
com.namelessmc.bot.connections.BackendStorageException: java.lang.UnsupportedOperationException
at com.namelessmc.bot.connections.StatelessConnectionManager.setUsernameSyncEnabled(StatelessConnectionManager.java:77)
at com.namelessmc.bot.commands.ConfigureCommand.changeUsernameSync(ConfigureCommand.java:248)
at com.namelessmc.bot.commands.ConfigureCommand.lambda$execute$0(ConfigureCommand.java:75)
at com.namelessmc.bot.Main.lambda$canModifySettings$2(Main.java:280)
at net.dv8tion.jda.internal.requests.DeferredRestAction.queue(DeferredRestAction.java:148)
at com.namelessmc.bot.Main.canModifySettings(Main.java:278)
at com.namelessmc.bot.commands.ConfigureCommand.execute(ConfigureCommand.java:62)
at com.namelessmc.bot.listeners.CommandListener.lambda$onSlashCommandInteraction$0(CommandListener.java:55)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.UnsupportedOperationException
... 14 more
[pool-1-thread-1] INFO com.namelessmc.bot.commands.ConfigureCommand - username_sync
Hello - i use your NamelessMC Link to integrate disocrd with my NamelessMC website, but when i use /apiurl and url for my API, i got error page - not json
My API url looks like like https://ultronarmy.faketube.cz/index.php?route=/api/v2/***
Where is the problem???
Can anyone help me?
I am on the latest dev build with the discord integration support. But I cannot find an invite link for the Nameless Link discord bot. Where/when is it?
Hi, get this error, when i try build the bot:
I run start.sh and all is connected but after use /configure, show this:
Dec 02, 2023 4:48:30 PM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer] Started.
[main] INFO com.namelessmc.bot.Main - Sending bot settings to https://xxx.net/index.php?route=/api/v2/
[main] INFO com.namelessmc.bot.Main - Sent bot settings to website and registered commands successfully.
[pool-1-thread-2] INFO Group sync discord->website - Sending roles for guild xxx to website
[JDA [0 / 1] MainWS-ReadThread] INFO com.namelessmc.bot.listeners.CommandListener - User xxx ran command /configure in guild xxxx
[pool-1-thread-4] INFO com.namelessmc.bot.commands.ConfigureCommand - Subcommand: link
[pool-1-thread-4] INFO com.namelessmc.bot.commands.ConfigureCommand - Checking if API URL works...
[pool-1-thread-4] INFO com.namelessmc.bot.commands.ConfigureCommand - Making request to info endpoint
[pool-1-thread-4] INFO com.namelessmc.bot.commands.ConfigureCommand - Website connection is working
[pool-1-thread-4] INFO com.namelessmc.bot.commands.ConfigureCommand - API URL seems to work. Sending bot settings...
[pool-1-thread-4] ERROR com.namelessmc.bot.commands.ConfigureCommand - storage backend
com.namelessmc.bot.connections.BackendStorageException: java.lang.UnsupportedOperationException
at com.namelessmc.bot.connections.StatelessConnectionManager.updateConnection(StatelessConnectionManager.java:54)
at com.namelessmc.bot.commands.ConfigureCommand.link(ConfigureCommand.java:147)
at com.namelessmc.bot.commands.ConfigureCommand.lambda$execute$0(ConfigureCommand.java:72)
at com.namelessmc.bot.Main.lambda$canModifySettings$2(Main.java:280)
at net.dv8tion.jda.internal.requests.DeferredRestAction.queue(DeferredRestAction.java:148)
at com.namelessmc.bot.Main.canModifySettings(Main.java:278)
at com.namelessmc.bot.commands.ConfigureCommand.execute(ConfigureCommand.java:62)
at com.namelessmc.bot.listeners.CommandListener.lambda$onSlashCommandInteraction$0(CommandListener.java:55)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.UnsupportedOperationException
... 14 more
[pool-1-thread-4] INFO com.namelessmc.bot.commands.ConfigureCommand - link
It is recommended to use one shard for about 450 guilds. As the bot is currently on 441 guilds, this limit is not far away. For now it would be enough to update from a single JDA instance to an instance of the ShardManager and set the amount of shards to 1. But if the size of the bot grows, you will need to increase the amount of shards as needed.
So my suggestion is for the forms module. If you have a forum for suggestions, you can send the posts to the discord with a webhook. My idea is to make the bot actually do this.
As seen in this image, the footer contains the user that sent the suggestion but also the amount of likes / dislikes it has. The bot would send this message and the message ID would be stored in the database. The ID is linked to the suggestion so if it gets liked, the bot can find what message linked to that suggestion.
When a suggestion gets a like / dislike, the website would send an event to the bot, which is in the guild and has the message id of the suggestion saved. The bot then requests the database looking for the message ID that is assigned to that suggestion. It then finds that message with the message ID in the guild and edits it. The like and dislike counter gets modified so the users in the discord know the amount of likes / dislikes a suggestion has.
This would mean you can remove bots that auto react with π and π and make the users just vote on the website. This means staff of the server can just sort the suggestions by vote count and get the top voted suggestions.
It also makes it so people in the discord itself can see the amount of votes and dont have to go to the website themselves to see it.
I tryed installing the Bot via docker how it is writen in the Wiki. But everytime is start the docker-compose.yaml file it just gives me this error :
Starting root_link_1 ... error
ERROR: for root_link_1 Cannot start service link: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused "rootfs_linux.go:58: mounting \"proc\" to rootfs \"/var/lib/docker/overlay2/7abf34f08f0e960f9ff48e989d8ccf8cb3599a5dd1ea0fc3375aa3d69cebdbfb/merged\" at \"/proc\" caused \"permission denied\""": unknown
ERROR: for link Cannot start service link: OCI runtime create failed: container_linux.go:349: starting container process caused "process_linux.go:449: container init caused "rootfs_linux.go:58: mounting \"proc\" to rootfs \"/var/lib/docker/overlay2/7abf34f08f0e960f9ff48e989d8ccf8cb3599a5dd1ea0fc3375aa3d69cebdbfb/merged\" at \"/proc\" caused \"permission denied\""": unknown
ERROR: Encountered errors while bringing up the project.
I have also tryed using the Manual version and it just gives me this error :
SEVERE: Guild with id 627786291618250752 does not exist. Is the ID wrong or is the bot not in this guild?
Yes, the Bot is in this Guild. Yes, the bot token is correct.
I am trying to do this on Linux / Ubuntu
java.lang.IllegalStateException: Preventing use of complete() in callback threads! This operation can be a deadlock cause
at net.dv8tion.jda.internal.requests.RestActionImpl.complete(RestActionImpl.java:216)
at net.dv8tion.jda.internal.requests.DeferredRestAction.complete(DeferredRestAction.java:172)
at net.dv8tion.jda.api.requests.RestAction.complete(RestAction.java:623)
at com.namelessmc.bot.Main.canModifySettings(Main.java:244)
at com.namelessmc.bot.commands.PingCommand.execute(PingCommand.java:48)
at com.namelessmc.bot.commands.Command.lambda$execute$0(Command.java:79)
at com.namelessmc.bot.commands.Command$$Lambda$283/0x00000000d80a77e8.accept(Unknown Source)
at net.dv8tion.jda.api.requests.Request.lambda$onSuccess$0(Request.java:95)
at net.dv8tion.jda.api.requests.Request$$Lambda$194/0x00000000043c6a48.run(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1429)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
When a user copy/pastes the (ex:)/verify 01234.5678
slash command from their user connections page and pastes it in a channel where the bot has permissions, the command does not run and there is no reply. To get it to work, a user must start to type /verify
, select the command from the matching suggestions popup, and then paste the token argument in its field. This adds even more steps to those which already need to be explained to users. Haven't tested if this happens when DM'ing the bot, but we generally prefer to use a verification channel.
We have observed the following scenario for over a year now:
It seems most users have an opposite workflow, whereas they want Discord to be the deciding source. Still, we'd like to suggest a checkmark in the Group Sync page of Nameless which lets us choose which source should take priority.
Possibly use JDA's format for consistency
I got the discord bot installed and got api enabled on namelessMC but when I try to do the !apiurl command with the bot I get the following error.
com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 22 path $
Unable to parse json. Received response code 200. Website response:
-----------------
<html><body><script type="text/javascript" src="/aes.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("f655ba9d09a112d4968c63579db590b4"),b=toNumbers("98344c2eee86c3994890592585b49f80"),c=toNumbers("1aac22b4c4689f3fbf9c263037840ded");document.cookie="__test="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/"; location.href="http://reimagine.rf.gd/index.php?route=/api/v2/BbLUC1WnGdeRI4fTp8Am3HKw5kMjOqu6/info&i=1";</script><noscript>This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support</noscript></body></html>
-----------------
any suggestions???
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.