discord-giveaways/enmap
Discord Giveaways framework using Enmap for storage.
This package supports all the functions like
reroll
,start
,end
of normal discord-giveaways packages. Refer to the documentation.
Functions
new GiveawayManager(client, options)
This function instantiates the giveaway manager class.
Example:
const GiveawayManager = ;clientgiveaways = ;
getAllGiveaways()
This function returns whole giveaways data.
Example:
const giveaways = await clientgiveaways;console;
saveGiveaway(message_id, giveaway_data)
This function saves the new giveaway data.
Example:
await clientgiveaways;console;
editGiveaway(message_id, data)
This function edits the existing giveaway.
Example:
await clientgiveaways;console;
deleteGiveaway(message_id)
This function deletes the giveaway.
Example:
await clientgiveaways;console;
filter(func)
This function can be used to filter through the giveaways.
Example:
const giveaways = clientgiveaways;console;
has(message_id)
This function can be used to check if the giveaway exists in database.
Example:
const has = clientgiveaways;if has console;
clear(boolean)
This function deletes all the existing giveaways.
Example:
clientgiveawaysclearfalse;console;
exportTo(path)
This function exports the giveaways data into json file in mentioned path.
Example:
await clientgiveaways;console;
importFrom(file)
This function imports the giveaways data from json file to the database. Existing data will be cleared!
Example:
await clientgiveaways;console;