kometh0616 / crown-bot Goto Github PK
View Code? Open in Web Editor NEWFMcord's "whoknows" feature and crown hierarchy system will be moved here.
License: MIT License
FMcord's "whoknows" feature and crown hierarchy system will be moved here.
License: MIT License
They are being ordered alphabetically rather than numerically, adding a .sort
here:
crown-bot/src/commands/crowns/guild.js
Line 26 in c858051
Should fix that.
I'm using the newest version of the bot.
TypeError: Cannot read property 'id' of undefined
data: index.js:1095 - at CrownsCommand.run (/home/arcyvilk/crown-bot/src/commands/crowns.js:43:30)
data: index.js:1095 - at CrownsCommand.execute (/home/arcyvilk/crown-bot/src/handler/Command.js:14:24)
data: index.js:1095 - at module.exports (/home/arcyvilk/crown-bot/src/events/message.js:11:19)
data: index.js:1095 - at CrownBot.emit (events.js:160:13)
data: index.js:1095 - at MessageCreateHandler.handle (/home/arcyvilk/crown-bot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
data: index.js:1095 - at WebSocketPacketManager.handle (/home/arcyvilk/crown-bot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
data: index.js:1095 - at WebSocketConnection.onPacket (/home/arcyvilk/crown-bot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
data: index.js:1095 - at WebSocketConnection.onMessage (/home/arcyvilk/crown-bot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
data: index.js:1095 - at WebSocket.onMessage (/home/arcyvilk/crown-bot/node_modules/ws/lib/event-target.js:120:16)
data: index.js:1095 - at WebSocket.emit (events.js:160:13)
data: index.js:1095 - at Receiver.receiverOnMessage (/home/arcyvilk/crown-bot/node_modules/ws/lib/websocket.js:789:20)
data: index.js:1095 - at Receiver.emit (events.js:160:13)
data: index.js:1095 - at Receiver.dataMessage (/home/arcyvilk/crown-bot/node_modules/ws/lib/receiver.js:422:14)
data: index.js:1095 - at Receiver.getData (/home/arcyvilk/crown-bot/node_modules/ws/lib/receiver.js:352:17)
data: index.js:1095 - at Receiver.startLoop (/home/arcyvilk/crown-bot/node_modules/ws/lib/receiver.js:138:22)
data: index.js:1095 - at Receiver._write (/home/arcyvilk/crown-bot/node_modules/ws/lib/receiver.js:74:10)
data: index.js:1095 - at doWrite (_stream_writable.js:407:12)
data: index.js:1095 - at writeOrBuffer (_stream_writable.js:393:5)
data: index.js:1095 - at Receiver.Writable.write (_stream_writable.js:290:11)
data: index.js:1095 - at TLSSocket.socketOnData (/home/arcyvilk/crown-bot/node_modules/ws/lib/websocket.js:864:35)
data: index.js:1095 - at TLSSocket.emit (events.js:160:13)
data: index.js:1095 - at addChunk (_stream_readable.js:269:12)
The related code:
let user
if (args.length > 0) {
if (cmds.includes(args[0])) {
const command = require(`./crowns/${args[0]}`)
await command.run(client, message, args.slice(1))
return
} else {
user = message.mentions.members.first()
}
} else {
user = message.member
}
const crowns = await client.models.crowns.findAll({
where: {
guildID: message.guild.id,
userID: user.id // <= here the bug triggers
}
})
They removed the ability for bots to react to messages to there is now no way to change pages on the crowns page.
I'm using the newest version of the bot.
data: index.js:1095 - TypeError: Cannot read property 'username' of null
data: index.js:1095 - at WhoKnowsCommand.run (/home/arcyvilk/crown-bot/src/commands/whoknows.js:30:28)
data: index.js:1095 - at <anonymous>
Looks like there's no error proofing in case where the user cannot be found by ID.
const user = await users.findOne({
where: {
userID: message.author.id
}
})
let artistName
if (args.length === 0) {
const params = stringify({
method: 'user.getrecenttracks',
user: user.username, // <= this bugs out
api_key: client.apikey,
format: 'json',
})
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.