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

upgrading discord library + adding new core contract #692

Merged
merged 1 commit into from
Oct 1, 2024
Merged
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"body-parser": "^1.15.2",
"chatgpt": "^5.2.5",
"croner": "^6.0.7",
"discord.js": "^14.6.0",
"discord.js": "^14.16.3",
"dotenv": "^16.0.3",
"eslint": "^8.26.0",
"eslint-config-airbnb-base": "^15.0.0",
Expand Down
5 changes: 5 additions & 0 deletions src/Classes/ArtIndexerBot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ export class ArtIndexerBot {

async handleNumberMessage(msg: Message) {
const content = msg.content

if (!msg.channel.isSendable()) {
return
}

if (content.length <= 1) {
msg.channel.send(
`Invalid format, enter # followed by the piece number of interest.`
Expand Down
12 changes: 12 additions & 0 deletions src/Classes/ProjectBot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ export class ProjectBot {

async handleNumberMessage(msg: Message) {
let content = msg.content
if (!msg.channel.isSendable()) {
return
}
if (content.length <= 1) {
msg.channel.send(
`Invalid format, enter # followed by the piece number of interest.`
Expand Down Expand Up @@ -249,6 +252,9 @@ export class ProjectBot {
*/
async sendMetaDataMessage(msg: Message, tokenID: string) {
let tokenMetadata
if (!msg.channel.isSendable()) {
return
}
try {
tokenMetadata = await getToken(`${this.coreContract}-${tokenID}`)
} catch (e) {
Expand Down Expand Up @@ -409,6 +415,9 @@ export class ProjectBot {
msg: Message,
upcomingDetails: UpcomingProjectDetailFragment
) {
if (!msg.channel.isSendable()) {
return
}
const startTime = new Date(
upcomingDetails.auction_start_time || upcomingDetails.start_datetime
)
Expand Down Expand Up @@ -496,6 +505,9 @@ export class ProjectBot {
}

async sendRandomOob(msg: Message) {
if (!msg.channel.isSendable()) {
return
}
const projectUrl = getProjectUrl(
this.coreContract,
this.projectNumber.toString()
Expand Down
Loading