userinfo: icons for activities
This commit is contained in:
		
							parent
							
								
									f6f7bf3d1f
								
							
						
					
					
						commit
						4a39ba26e8
					
				
					 2 changed files with 19 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -16,6 +16,12 @@ const {formatUsername, getDefaultAvatar, getGuild, getTopColor, pastelize} = req
 | 
			
		|||
const {snowflakeToTimestamp} = require("#util/time.js");
 | 
			
		||||
const {lookupUser} = require("#util/selection.js");
 | 
			
		||||
 | 
			
		||||
const ActivityTypeIcons = {
 | 
			
		||||
  0: Icons.playing,
 | 
			
		||||
  2: Icons.listening,
 | 
			
		||||
  3: Icons.watching,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const ONE_MONTH = 2628000;
 | 
			
		||||
 | 
			
		||||
let vencordFetch = 0;
 | 
			
		||||
| 
						 | 
				
			
			@ -368,7 +374,15 @@ userinfo.callback = async function (msg, line) {
 | 
			
		|||
        if (activity.type == 4 || activity.type == 6) {
 | 
			
		||||
          descLines.push(ActivityTypeNames[activity.type]);
 | 
			
		||||
        } else {
 | 
			
		||||
          descLines.push(`${ActivityTypeNames[activity.type]} **${activity.name}**`);
 | 
			
		||||
          descLines.push(
 | 
			
		||||
            `${activity.name === "Spotify" ? Icons.spotify : ActivityTypeIcons[activity.type] ?? ""} ${
 | 
			
		||||
              ActivityTypeNames[activity.type]
 | 
			
		||||
            } **${
 | 
			
		||||
              activity.name === "Spotify"
 | 
			
		||||
                ? `[${activity.state}](https://open.spotify.com/track/${activity.sync_id})`
 | 
			
		||||
                : activity.name
 | 
			
		||||
            }**`.trim()
 | 
			
		||||
          );
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -581,6 +581,10 @@ module.exports.Icons = {
 | 
			
		|||
  offline: "<:i:1273105449318875228>",
 | 
			
		||||
  blank: "<:i:1273123564173918268>",
 | 
			
		||||
  boat: "<:i:1273105457661087755>",
 | 
			
		||||
  playing: "<:i:1392584288515395635>",
 | 
			
		||||
  listening: "<:i:1392584301367001148>",
 | 
			
		||||
  watching: "<:i:1392584313786208296>",
 | 
			
		||||
  spotify: "<:i:1392584323932360744>",
 | 
			
		||||
  fedimbed: {
 | 
			
		||||
    quote: "<:Quotes:1308640087759654922>",
 | 
			
		||||
    reply: "<:Replies:1308640078825787412>",
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue