Ignore not having access to read pins
This commit is contained in:
		
							parent
							
								
									3975550582
								
							
						
					
					
						commit
						22c569c701
					
				
					 1 changed files with 8 additions and 1 deletions
				
			
		|  | @ -25,7 +25,14 @@ function convertTimestamp(timestamp) { | |||
|  * @param {number?} convertedTimestamp | ||||
|  */ | ||||
| async function updatePins(channelID, roomID, convertedTimestamp) { | ||||
| 	const discordPins = await discord.snow.channel.getChannelPinnedMessages(channelID) | ||||
| 	try { | ||||
| 		var discordPins = await discord.snow.channel.getChannelPinnedMessages(channelID) | ||||
| 	} catch (e) { | ||||
| 		if (e.message === `{"message": "Missing Access", "code": 50001}`) { | ||||
| 			return // Discord sends channel pins update events even for channels that the bot can't view/get pins in, just ignore it
 | ||||
| 		} | ||||
| 		throw e | ||||
| 	} | ||||
| 	const pinned = pinsToList.pinsToList(discordPins) | ||||
| 
 | ||||
| 	const kstate = await ks.roomToKState(roomID) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue