Reply to thread
GBAtemp.net - The Independent Video Game Community
Search
Search titles only
By:
Search titles only
By:
Reply to thread
GBAtemp.net - The Independent Video Game Community
Home
Log in
Terms & Rules
Donate
Forums
New posts
Search forums
Groups
Public Events
New
New posts
New resources
New blog entries
New profile posts
New blog entry comments
New threadmarks
Latest activity
Cheats
Cheat Codes Add and Request group
The Legend of Zelda: Tears of the Kingdom cheat codes
Pokémon Legends: Arceus cheat codes
Xenoblade Chronicles 3 cheat codes
Fire Emblem Engage cheat codes
Request a cheat...
Tutorials
Nintendo Switch tutorials
Nintendo 3DS tutorials
Nintendo Wii U tutorials
Reviews
Overview
Official reviews
User reviews
Downloads
Latest reviews
Search resources
Blogs
New entries
New comments
Blog list
Search blogs
Chat
Top chatters
Search
Search titles only
By:
Search titles only
By:
Log in
Register
New posts
Search forums
Log in
Register
Home
Forums
PC, Console & Handheld Discussions
Nintendo 3DS
[Release] Discord 3DS Client
Menu
Install the app
Install
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Sleepy Flower Girl" data-source="post: 9336811" data-attributes="member: 384358"><p>I've been getting messages asking how to make a Discord Client. For the sake of not repeating myself. I'll go over the many steps. Firstly, I need to say that doing so is against the TOS if you are using a user account. I generally only use the client with a bot account. Anyway, you'll need to understand the Discord API and it's protocols. The main protocols being WebSockets, HTTPS, and JSON. These protocols also use other protocols, such as TLS and TCP. I've made a Discord library for bots, not clients, so I used what I made. Unless, you are very familiar with the APIs, I recommend using a Discord library. You'll need to modify them as they generally don't support custom clients. Discord updates their API sometimes to add features that can break your client, so you'll need update the library and client when that happens.</p><p></p><p>My library was made to be modular, so I used this as a test to see if modules can add support for strange platforms. We'll need a module for the 2 protocols that work differently on different platforms. Those being the ones that rely on the internet protocol or sockets, so WebSockets, and HTTPS. At first, I used the HTTP library that was part of the homebrew SDK but Discord would reject it a lot. I used my own, as libcurl isn't available though the homebrew SDK. Wslay is a WebSockets library that uses callbacks, this is where you give functions for wslay to use to access things like TLS and HTTPS. We write the needed functions for wslay which use the homebrew SDK's TLS, and our HTTPS library. The HTTPS library is where the TLS connection is first created, however unlike most HTTPS request, which end after getting a response, we keep it open and must poll it and wslay. This should let you connect to Discord's WebSockets server, gateways as Discord likes to call it.</p><p></p><p>Now, we need to keep the connection open. There's a number of task that need to be done to do this, the library will handle most of them without help but some (reconnects, connection health check, etc.) require a timer running in the background. So you'll need to implement a timer system that does the task at the time given. The current version does a "temporary" solution. A list of task to do and when to do them is stored. When as task needs to be done, we add them to the list. 3DS programs have, what the SDK calls, the main loop, where code runs over and over again until the user press close on the system UI. In there we check if it's time to do a task and then do that task. This was going to be temporary, as this isn't that great of a solution as it doesn't make use of threads or async. The connection should stay open after all this.</p><p></p><p>After that, you'll need the client to listen for Discord events. This is where you'll get your data, and a lot of data. Most of the data, you don't need right away but Discord isn't going to give you the same data more then once. So, you'll need to store it somewhere. As a "temporary" solution, I used the memory. At first I used hash maps because accessing data from one is quick even for lots of data. However, it would quickly ran out of ram, so I used linked lists, which is slower when accessing data when dealing with lots of data but it used less memory. Again, "temporary solution". I also did some optimizations on everything above and the data needed to be stored but it'll always run out of memory at some point. It'll happen faster if you are on more servers, big servers, very active, or worse, all the above. A more permanent solution would be some cache system that stored this data off the memory if it's not needed just yet. However, remember we are working with SD cards, which aren't known for fast random read and write speeds or much storage space. Looking back, working on getting async working would have really helped here.</p><p></p><p>Of course, finally, what good is a client where you can't see messages. I'm sure there are frontend frameworks or libraries that does this for you but I made my own and I don't feel like getting into that stuff. It drew triangles, making a rectangle, with textures and positioned them using the C3D library.</p><p></p><p>Hopefully now, you understand the amount of effort and knowledge getting a Discord client on the 3DS requires. Thanks for reading this long and technical write up.</p></blockquote><p></p>
[QUOTE="Sleepy Flower Girl, post: 9336811, member: 384358"] I've been getting messages asking how to make a Discord Client. For the sake of not repeating myself. I'll go over the many steps. Firstly, I need to say that doing so is against the TOS if you are using a user account. I generally only use the client with a bot account. Anyway, you'll need to understand the Discord API and it's protocols. The main protocols being WebSockets, HTTPS, and JSON. These protocols also use other protocols, such as TLS and TCP. I've made a Discord library for bots, not clients, so I used what I made. Unless, you are very familiar with the APIs, I recommend using a Discord library. You'll need to modify them as they generally don't support custom clients. Discord updates their API sometimes to add features that can break your client, so you'll need update the library and client when that happens. My library was made to be modular, so I used this as a test to see if modules can add support for strange platforms. We'll need a module for the 2 protocols that work differently on different platforms. Those being the ones that rely on the internet protocol or sockets, so WebSockets, and HTTPS. At first, I used the HTTP library that was part of the homebrew SDK but Discord would reject it a lot. I used my own, as libcurl isn't available though the homebrew SDK. Wslay is a WebSockets library that uses callbacks, this is where you give functions for wslay to use to access things like TLS and HTTPS. We write the needed functions for wslay which use the homebrew SDK's TLS, and our HTTPS library. The HTTPS library is where the TLS connection is first created, however unlike most HTTPS request, which end after getting a response, we keep it open and must poll it and wslay. This should let you connect to Discord's WebSockets server, gateways as Discord likes to call it. Now, we need to keep the connection open. There's a number of task that need to be done to do this, the library will handle most of them without help but some (reconnects, connection health check, etc.) require a timer running in the background. So you'll need to implement a timer system that does the task at the time given. The current version does a "temporary" solution. A list of task to do and when to do them is stored. When as task needs to be done, we add them to the list. 3DS programs have, what the SDK calls, the main loop, where code runs over and over again until the user press close on the system UI. In there we check if it's time to do a task and then do that task. This was going to be temporary, as this isn't that great of a solution as it doesn't make use of threads or async. The connection should stay open after all this. After that, you'll need the client to listen for Discord events. This is where you'll get your data, and a lot of data. Most of the data, you don't need right away but Discord isn't going to give you the same data more then once. So, you'll need to store it somewhere. As a "temporary" solution, I used the memory. At first I used hash maps because accessing data from one is quick even for lots of data. However, it would quickly ran out of ram, so I used linked lists, which is slower when accessing data when dealing with lots of data but it used less memory. Again, "temporary solution". I also did some optimizations on everything above and the data needed to be stored but it'll always run out of memory at some point. It'll happen faster if you are on more servers, big servers, very active, or worse, all the above. A more permanent solution would be some cache system that stored this data off the memory if it's not needed just yet. However, remember we are working with SD cards, which aren't known for fast random read and write speeds or much storage space. Looking back, working on getting async working would have really helped here. Of course, finally, what good is a client where you can't see messages. I'm sure there are frontend frameworks or libraries that does this for you but I made my own and I don't feel like getting into that stuff. It drew triangles, making a rectangle, with textures and positioned them using the C3D library. Hopefully now, you understand the amount of effort and knowledge getting a Discord client on the 3DS requires. Thanks for reading this long and technical write up. [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
PC, Console & Handheld Discussions
Nintendo 3DS
[Release] Discord 3DS Client
General chit-chat
Help
Users
Settings
Notifications
Miscellaneous
Inverse message direction
Display editor on top
Enable maximized mode
Display images as links
Hide bot messages
Hide statuses
Hide chatter list
Show messages from ignored users
Temporarily disable chat
Receive mention alerts
Sound notifications
Normal messages
Private messages
Whisper messages
Mention messages
Bot messages
Desktop notifications
Normal messages
Private messages
Whisper messages
Mention messages
Bot messages
Options
Options
View top chatters
No one is chatting at the moment.
@
K3Nv2
:
If it didn't then why won't your wife leave my place
Today at 12:35 AM
@
BigOnYa
:
rick james- Cocaine is a hella of a drug
+1
Today at 12:36 AM
@
BigOnYa
:
Nuh for real tho, tell her to get food on her way home, I feel like cheeseburgers tonight
+1
Today at 12:39 AM
@
Psionic Roshambo
:
Tried to get McDonald's on the way home app glitched lol
Today at 12:54 AM
@
Psionic Roshambo
:
Now I'm like ughh what to eat....
Today at 12:55 AM
@
K3Nv2
:
They keep bringing back $1 big macs the bastards know how to fuel addiction
+1
Today at 1:00 AM
@
K3Nv2
:
Apps should allow us to use deals and rewards two sperate things
Today at 1:01 AM
@
Psionic Roshambo
:
Yeah for sure lol
Today at 1:08 AM
@
Psionic Roshambo
:
https://m.youtube.com/watch?v=DiXVXw5ELqA&pp=ygUYTW9yZSBpbnNhbmUgOTBzIGdhbWUgYWRz
Today at 1:21 AM
@
K3Nv2
:
I tried frozen pf changes for $5 not really worth it
Today at 1:52 AM
@
Psionic Roshambo
:
Hell the normal restaurant kinda sucks too
+1
Today at 1:53 AM
@
Psionic Roshambo
:
https://www.pinterest.com/pin/breathe-new-life-into-your-nintendo-for-under-20--141933825732971424/
Today at 2:03 AM
@
Psionic Roshambo
:
Lol BJ lol
+1
Today at 2:03 AM
@
BigOnYa
:
Sometimes that's all you you need, to bring back to life, i need to put that on my medical card, patient refuses mouth to mouth, but instead...
+1
Today at 2:04 AM
@
Psionic Roshambo
:
Lol so true
Today at 2:12 AM
@
Psionic Roshambo
:
I think it worked on Ring King for the NES.... Come to think of it NES had a lot of homo erotica lol
+1
Today at 2:17 AM
@
Psionic Roshambo
:
https://m.youtube.com/watch?v=FWGUSiYQFAQ
+1
Today at 2:17 AM
@
K3Nv2
:
https://youtu.be/amAULN7yJis?si=JWDANkaENVhXuLBd
stay out of the water Psi
Today at 2:23 AM
@
Psionic Roshambo
:
Ken those are the meth sharks
Today at 2:34 AM
@
K3Nv2
:
The samoliapidates had to hide it some place
Today at 2:35 AM
@
K3Nv2
:
Damn jack must've came loose outside over all the weather and a tech can't come out until the 11th I need to look into a device that's usb Hotspot that can leach from a phone
Today at 2:49 AM
@
K3Nv2
:
oh shiz something could be happening
Today at 4:40 AM
@
SylverReZ
:
https://www.youtube.com/watch?v=Thf30D0atcM
48 minutes ago
@
SylverReZ
:
https://www.youtube.com/watch?v=RH1Do1-qGBU
44 minutes ago
@
SylverReZ
:
@Psionic Roshambo
,
35 minutes ago
Submit
@
SylverReZ
:
@Psionic Roshambo,
35 minutes ago
Chat
0