Add the emoji mapping to the database
This commit is contained in:
		
							parent
							
								
									b31b7c794c
								
							
						
					
					
						commit
						94c4b6a262
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -29,8 +29,9 @@ async function emojisToState(emojis) {
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				url
 | 
									url
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
								db.prepare("INSERT OR IGNORE INTO emoji (emoji_id, animated, mxc_url) VALUES (?, ?, ?)").run(emoji.id, +!!emoji.animated, url)
 | 
				
			||||||
		}).catch(e => {
 | 
							}).catch(e => {
 | 
				
			||||||
			if (e.data.errcode === "M_TOO_LARGE") { // Lol.
 | 
								if (e.data.errcode === "M_TOO_LARGE") { // Very unlikely to happen. Only possible for 3x-series emojis uploaded shortly after animated emojis were introduced, when there was no 256 KB size limit.
 | 
				
			||||||
				return
 | 
									return
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
			console.error(`Trying to handle emoji ${emoji.name} (${emoji.id}), but...`)
 | 
								console.error(`Trying to handle emoji ${emoji.name} (${emoji.id}), but...`)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue