mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
fix: fix crash in AutoReactions if a message is posted in an uncached thread
This commit is contained in:
parent
d67dee7cfd
commit
058643f360
1 changed files with 5 additions and 0 deletions
|
@ -16,6 +16,11 @@ export const AddReactionsEvt = autoReactionsEvt({
|
||||||
allowSelf: true,
|
allowSelf: true,
|
||||||
|
|
||||||
async listener({ pluginData, args: { message } }) {
|
async listener({ pluginData, args: { message } }) {
|
||||||
|
const channel = await message.guild?.channels.fetch(message.channelId);
|
||||||
|
if (!channel) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let autoReaction: AutoReaction | null = null;
|
let autoReaction: AutoReaction | null = null;
|
||||||
const lock = await pluginData.locks.acquire(`auto-reactions-${message.channel.id}`);
|
const lock = await pluginData.locks.acquire(`auto-reactions-${message.channel.id}`);
|
||||||
if (pluginData.state.cache.has(message.channel.id)) {
|
if (pluginData.state.cache.has(message.channel.id)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue