Giter Site home page Giter Site logo

phineas / lanyard Goto Github PK

View Code? Open in Web Editor NEW
943.0 943.0 139.0 424 KB

๐Ÿท๏ธ โ€†โ€†Expose your Discord presence and activities to a RESTful API and WebSocket in less than 10 seconds

Home Page: https://discord.gg/lanyard

License: MIT License

Elixir 99.26% Dockerfile 0.74%
discord discord-rpc elixir

lanyard's Introduction

Hey, I'm Phin ๐Ÿ‘‹

I'm a 22 year old developer and founder. I like to write reliable code and hack with new, unique technologies.

Interested in realtime software, delightful & robust UX, network engineering and cute things! I'm currently learning Japanese and plan to move to Japan in the near future. ใซใ‚ƒใ‚ใ‚ใ‚ใƒผ

ใƒ•ใ‚ฃใƒณใ•ใ‚“ใงใ™ใ€ๅƒ•ใฏ๏ผ’๏ผ’ๆ‰ใงใ€ใƒ‡ใƒ™ใƒญใƒƒใƒ‘ใจใƒใƒƒใƒˆใƒฏใƒผใ‚ฏใ‚จใƒณใ‚ธใƒ‹ใ‚ขใ€‚ไฟก้ ผๆ€งใฎ้ซ˜ใ„ใ‚ณใƒผใƒ‰ใŠ้–‹็™บใ—ใŸใ‚Šใ€ๆ–ฐใ—ใ„ๆŠ€่ก“ใ‚’ๅฎŸ้จ“ใ—ใŸใ‚Šใ™ใ‚‹ใ“ใจใŒๅฅฝใใงใ™ใ€‚ๅƒ•ไธปใซ Reactใ€Elixirใ€TypeScript ใ‚’ไฝฟใ„ใพใ™ใ€‚

๐Ÿ”ญ Current

I'm currently working on Hop - we're a cloud platform focusing on supporting real-time, high-bandwidth applications. With Hop Ignite, you can deploy any app to Hop directly from GitHub and achieve global low-latency content delivery - it's super easy, and we'll automatically handle new builds and rollouts when you push to the main branch. :)

โšก๏ธ Experience

I like to say that I'm full-stack, though I'm mostly experienced in real-time systems. I highly leverage Elixir to build scalable realtime systems, and I pair that with React on the frontend. I've been working with React for about 7 years, Elixir for almost 6, and JavaScript for more than 8 years.

๐Ÿ“ซ Contact

To contact me quickly and easily, DM me on Twitter.

If it makes more sense, you can also email me:

General Inquiries: [email protected]
Hop-related Inquiries: [email protected]

If your inquiry is related to a network I manage or control (e.g. AS952 or AS399531), please send an email to my email listed on the respective WHOIS contact. If it's a P1 emergency, you can email [email protected].

lanyard's People

Contributors

amineohn avatar ardasoyturk avatar barbarbar338 avatar cancodes avatar chezzzer avatar d3r1n avatar discordanaxes avatar dustinrouillard avatar eggsy avatar elevenski avatar emirkabal avatar encrypteddev avatar geenva avatar heyimnitho avatar iamasink avatar itzpolah avatar leonardssh avatar loom4k avatar makidoll avatar malloryhayr avatar mehmetali345dev avatar meppu avatar nebulatgs avatar officialcrugg avatar pateln123 avatar phineas avatar punctuations avatar pxseu avatar robjmorrissey avatar sayanzyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lanyard's Issues

Discord Status

So im having an issue with the "discord_status":"..." not showing up correctly and I have as my snippet:

				{#if userPresence.discord_status === 'offline'}
					<br />
					Offline
				{:else}
					<div
						class="inline-block text-sm drop-shadow-3xl shadow-orange-300/50 bg-gradient-to-r from-blue-500/[.15] ring-2 ring-orange-800/95 rounded-md p-3 -ml-6"
					>
						{#if userPresence.discord_status === 'idle'}
							๐ŸŸก Idle&nbsp;&nbsp;
						{:else if userPresence.discord_status === 'dnd'}
							๐ŸŸ  Do Not Disturb&nbsp;&nbsp;
						{:else}
							๐ŸŸข Online&nbsp;
						{/if} 

and my <script></script> is:

	// check if the user is currently in VSCode
	$: inVSCode =
		userPresence?.data?.discord_status == 'dnd' &&
		userPresence?.data?.activities?.find((activity) => activity?.name == 'Visual Studio Code');

	// get the icon to display based on whether the user is listening to Spotify or coding in VSCode
	$: statusIcon = inVSCode ? VSCODE_ICON : currentActivity ? SPOTIFY_ICON : null;

	// check if the user is online or idle
	$: isOnline =
		userPresence?.discord_status === 'online' || userPresence?.discord_status === 'idle';

	// get the details of the user's current VSCode session
	$: vsCodeSession = userPresence?.data?.activities?.find(
		(activity) => activity?.name === 'Visual Studio Code'
	);

	// get the name and ID of the current file being edited
	$: fileName = vsCodeSession?.details?.match(/(?<=๐Ÿ“\s).+(?=\s\|)/)?.[0];
	$: fileId = vsCodeSession?.id;

	// get the line number being edited
	$: lineNum = vsCodeSession?.details?.match(/(?<=๐Ÿ“ Editing line ).+(?=\/)/)?.[0] ?? '';

	// construct the status message to display
	$: statusMessage =
		isOnline && inVSCode && fileName && lineNum
			? `Editing ${fileName} on line ${lineNum} in VSCode`
			: isOnline && currentActivity
			? `Listening to ${currentSong}`
			: 'Offline';
			```
So when I manually change the status to test it, it works via lanyard api and shows the correct status but, it change on my webpage.

Is anyone else having this issue or is it just me?

Suggestion: Custom CORS Header?

Now, Every website can access our Discord status with the lanyard API but with custom CORS (cross-origin resource sharing) headers we can set what websites can access our status.

Time Elapsed?

I'd like to be able to see time elapsed with Lanyard.

Missing info at example response: spotify track id

Real Response:

"spotify": {
            "track_id": "3iag81mU7BylirRwRYXd8E",
            "timestamps": {
                "start": 1628585067370,
                "end": 1628585292130
            },
            "song": "I'm Only Joking",
            "artist": "KONGOS",
            "album_art_url": "https://i.scdn.co/image/ab67616d0000b27367ff87e2839c5c93bb6e6a6a",
            "album": "Lunatic"
},

the one in the readme:

"spotify": {
      "timestamps": {
        "start": 1615529820677,
        "end": 1615530068733
      },
      "song": "Let Go",
      "artist": "Ark Patrol; Veronika Redd",
      "album_art_url": "https://i.scdn.co/image/ab67616d0000b27364840995fe43bb2ec73a241d",
      "album": "Let Go"
},

Last seen feature

Adding last_seen timestamp when user is offline/invisible might be useful since it can tell when the last time user is active.

connection that looks like tls received on a clear channel

Hey,
I've encountered spam of this warning, when trying to load a []:4001.
I know that it's just practically saying the connection isn't secured, but I don't know why it's always throwing me a connection reset (ERR_CONNECTION_RESET).

Mentioned warning:
Termius_CsomxwJ6hC

Error in Self Hosting

{"success":false,"error":{"message":"User is not being monitored by Lanyard","code":"user_not_monitored"}}

Discord Bio & Banner?

Hey there,
would it be possible to also put a user's bio and their banner on the User Endpoint?

Needed help.

Hello!

Basically I have some problems with my website.
At first, timestamps are not working correctly.
image
And second. Song/video doesnt update some times
image
And finally. When presence doesnt have timestamp, console goes crazy.
image

Discord Bots?

Make it so that we can invite bots to the lanyard server (without permissions ofc) so that we can see if our bots is online or not

New username system

Hello, as you have probably seen already, usernames are evolving on discord. Therefore, the old way of displaying the tag will become obsolete (see image).

Are there any update planned to evolve according to these changes ?

I'm also mentionning that a new badge has also appeared in relation to these changes so maybe it could be added as well.

image

Lanyard API not working

On my Website avyanshralph.vercel.app The Discord Activity status is not showing when hosted on vercel but it shows when I host it locally... Pls tell the reason behind this issue

Regards,
Avyansh Ralph
Owner of Airdown

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.