Skip to main content

Migrating to v4

Coming from v3 ? Everything looks weird and new ? Don't worry. We got you with a migration guide.

Summary

Deprecated functions.

  • We deprecated few functions to make their names meaningfull. This is the list of what functions are deprecated
@@ In favor of new names @@

- automeme()
+ meme()

- bumpSystem()
+ bumpReminder()

- embedCreate()
+ embedCreator()

- embedPages()
+ buttonPages()

- giveawaySystem()
+ giveaway()

- suggestSystem()
+ suggest()

- ticketSystem()
+ ticketSetup()

- manageBtn()
+ manageBtnRole()
+ manageTicket()
+ manageGiveaway()

- manageSug()
+ manageSuggest()

- stealEmoji()

- nqn()

Changed option names

  • Previously we had meaningless variable and option names. Now that's gone. Everything has proper name. Making it easier to contribute and debug. Please visit the documentation of the specific function to learn more.

Removal of client argument

  • We finally figured out how to get client property without an useless argument. Please visit the documentation of the specific function to learn more.

Example:

chatbot.js
// From
simplydjs.chatbot(client, message, {
channelId: '01234567890123'
})

// To
simplydjs.chatbot(message, {
channelId: '01234567890123'
})

Complications in embed option

  • As we added more customization in embed option, It makes the option much complicated. So please visit the documentation of the specific function to learn more.

Example:

tictactoe.js
// From
simplydjs.tictactoe(interaction, {
embed: {
title: "Tic Tac Toe",
description: "This is an example embed of tictactoe",
color: "#075FFF"
}
})

// To
simplydjs.tictactoe(interaction, {
embed: {
game: {
title: "Tic Tac Toe",
description: "This is an example embed of tictactoe",
color: simplydjs.toRgb('#406dbc')
},
draw: {
title: "Oh no",
description: "That was a tie.",
color: "LightGrey"
},
win: {
title: "You won",
description: "Yay you won congrats",
color: 'DarkGreen'
}
}
})

Deprecation of Hex codes

  • Discord.JS will not allow hex codes (in future). To accompany this, we made a function toRgb() to convert your hex code to RGB Array.

  • You can use hex codes until Discord.JS allows

calculator.js
// From
simplydjs.calculator(interaction, {
embed: {
color: "#406dbc"
}
})

// To
simplydjs.calculator(interaction, {
embed: {
color: simplydjs.toRgb("#406dbc")
}
})

Deprecating legacy button styles

  • Discord.JS moved from string to enum type for their Button styles leading to deprecation of string typed button styles.

For Example,

Discord.JS
// Wrong
button: {
style: "PRIMARY" // We still support this type but discord.js don't
}
Discord.JS
// Right
import { ButtonStyle } from "discord.js"

button: {
style: ButtonStyle.Primary // This is an enum type
}
  • But we still support legacy style for buttons. So there is no hassle to migrate it. But we recommend changing to ButtonStyle enum.