Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closes wwosimulation/tracker/issues/583 #406

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commands/economy/buy.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ module.exports = {

if (!enoughMoney(item, info.amount || 1)) return l10nMesssage({ code: "notEnoughCurrency", toReplace: { currency: item.currency + "s" } })

if (["profile", "cmi", "autoReact"].includes(dbName)) {
if (["profile", "cmi", "autoReact", "rename"].includes(dbName)) {
obj[dbName] = true
}

Expand Down
2 changes: 1 addition & 1 deletion commands/game/activate.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
const players = db.get(`players`)
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

magic number (or more like string but ya get what i mean)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really important considering it repeats in so many locations

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also good practice ig


if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to activate traps.")
if (!["Trapper"].includes(player.role) && !["Trapper"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/bless.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
const wwchat = message.guild.channels.cache.find((c) => c.name === "werewolves-chat")
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to bless players.")
if (!["Astral Wolf"].includes(player.role) && !["Astral Wolf"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/bomb.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = {
return arr
}

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

let player = db.get(`player_${message.author.id}`) || { status: "Dead" } // get the player object
let night = Math.floor(gamePhase / 3) + 1
Expand Down
2 changes: 1 addition & 1 deletion commands/game/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
const wwchat = message.guild.channels.cache.find((c) => c.name === "werewolves-chat")
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (!["Pumpkin King"].includes(player.role) && !["Pumpkin King"].includes(player.dreamRole)) return
if (["Pumpkin King"].includes(player.dreamRole)) player = db.get(`player_${player.target}`)
Expand Down
2 changes: 1 addition & 1 deletion commands/game/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
const wwchat = message.guild.channels.cache.find((c) => c.name === "werewolves-chat")
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to check players.")
if (!["Seer", "Aura Seer", "Spirit Seer", "Detective", "Wolf Seer", "Sorcerer", "Sheriff", "Evil Detective", "Mortician", "Analyst", "Harbinger", "Lethal Seer"].includes(player.role) && !["Seer", "Aura Seer", "Spirit Seer", "Detective", "Wolf Seer", "Sorcerer", "Sheriff", "Evil Detective", "Mortician", "Analyst", "Harbinger", "Lethal Seer"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
const players = db.get(`players`) || []
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to convert players.")
if (!["Zombie", "Sect Leader", "Bandit"].includes(player.role) && !["Zombie", "Sect Leader", "Bandit"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
const players = db.get(`players`) || []
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to copy players.")
if (!["Doppelganger"].includes(player.role) && !["Doppelganger"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/corrupt.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
const players = db.get(`players`) || []
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to corrupt players.")
if (!["Corruptor"].includes(player.role) && !["Corruptor"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/couple.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
const players = db.get(`players`) || []
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to couple players.")
if (!["Cupid"].includes(player.role) && !["Cupid"].includes(player.dreamRole)) return
Expand Down
71 changes: 0 additions & 71 deletions commands/game/d.js

This file was deleted.

2 changes: 1 addition & 1 deletion commands/game/douse.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
const players = db.get(`players`) || []
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to douse players.")
if (!["Arsonist"].includes(player.role) && !["Arsonist"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/eat.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
const players = db.get(`players`) || []
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to eat players.")
if (!["Cannibal"].includes(player.role) && !["Cannibal"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/enchant.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
const players = db.get(`players`) || []
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to enchant players.")
if (!["Wolf Shaman", "Illusionist"].includes(player.role) && !["Wolf Shaman", "Illusionist"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/flee.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = {
client.emit("playerKilled", db.get(`player_${guy.id}`), "NARRATOR")
}
}
} else if (message.channel.name.includes("priv") || message.channel.name == "day-chat") {
} else if (message.channel?.parentId == "892046231516368906" || message.channel.name == "day-chat") {
if (!message.member.roles.cache.has(ids.alive)) return
let row = {
type: 1,
Expand Down
2 changes: 1 addition & 1 deletion commands/game/forge.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
const wwchat = message.guild.channels.cache.find((c) => c.name === "werewolves-chat")
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to forge players.")
if (!["Forger"].includes(player.role) && !["Forger"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/frenzy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
const wwchat = message.guild.channels.cache.find((c) => c.name === "werewolves-chat")
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to activate frenzy.")
if (!["Werewolf Berserk"].includes(player.role) && !["Werewolf Berserk"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/give.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
const players = db.get(`players`) || []
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to give out items.")
if (!["Fortune Teller", "Santa Claus", "Easter Bunny", "Forger", "Alchemist", "Baker", "Warden"].includes(player.role) && !["Fortune Teller", "Santa Claus", "Easter Bunny", "Forger", "Alchemist", "Baker", "Warden"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/hack.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
const wwchat = message.guild.channels.cache.find((c) => c.name === "werewolves-chat")
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to mute players.")
if (!["Hacker"].includes(player.role) && !["Hacker"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/hunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
const wwchat = message.guild.channels.cache.find((c) => c.name === "werewolves-chat")
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to hunt players.")
if (!["Sect Hunter"].includes(player.role) && !["Sect Hunter"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/hypnotize.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
const wwchat = message.guild.channels.cache.find((c) => c.name === "werewolves-chat")
let player = db.get(`player_${message.author.id}`) || { status: "Dead" }

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to hypnotize players.")
if (!["Dreamcatcher"].includes(player.role) && !["Dreamcatcher"].includes(player.dreamRole)) return
Expand Down
2 changes: 1 addition & 1 deletion commands/game/ignite.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
const stubbornWerewolves = require("../narrator/day/killingActions/protection/stubbornWolves.js") // stubborn ww
const surrogate = require("../narrator/day/killingActions/protection/surrogate.js") // surrogate

if (!message.channel.name.startsWith("priv")) return // if they are not in the private channel
if (!message.channel.parentId == "892046231516368906") return // if they are not in the private channel

if (player.status !== "Alive") return await message.channel.send("Listen to me, you need to be ALIVE to ignite players.")
if (!["Arsonist"].includes(player.role) && !["Arsonist"].includes(player.dreamRole)) return
Expand Down
Loading