Giter Club home page Giter Club logo

kiwi's Introduction

the kiwi logo

kiwi

Discord giveaway bot written with TypeScript using Deno KV's new features:

  • listenQueue: Listen for queue values to be delivered from the database queue, which were enqueued with Deno.Kv.enqueue.
  • enqueue: Add a value into the database queue to be delivered to the queue listener via Deno.Kv.listenQueue.

Create giveaways and let your users participate with a single click. Leverage the power of Deno KV's new features to create a scalable and reliable way to schedule tasks in the future.

Invite the bot to your server and start using it today by clicking this link.

commands

  • create: Creates a giveaway with the following arguments:
    • prize: The prize of the giveaway, supports markdown syntax highlighting.
    • duration: The time the giveaway will last, supports human readable time formats.
    • message: The message shown in the giveaway embed, can be used to add additional information about the giveaway.
    • image: Optional image url to be shown in the giveaway embed. Modifies the color of the embed to match the image.
    • winners: The amount of winners the giveaway will have.

creating a giveaway

  1. First of all, go to the channel you want to create the giveaway in and fill in the /create command with the required arguments.

create command

  1. After the giveaway has been created, the bot will send a message with the giveaway embed and a button to enter the giveaway.
  1. Click the button to enter the giveaway. If you win, your username will be mentioned in the giveaway embed.

    participation

feedback

  • straightforward API for enqueue and listenQueue
  • great usecase for a wide range of applications
  • will definitely use this in the future
  • docs still need some work, how do I mock listenQueue errors?
  • don't see the use for keysIfUndelivered
  • re-delivery of errored keys should be incremental to avoid stress

development

Install deno if you haven't already:

curl -fsSL https://deno.land/x/install/install.sh | sh

Clone the repo:

git clone [email protected]:Jabolol/kiwi.git .

Create and fill in the .env file:

# The public key of your discord application
DISCORD_PUBLIC_KEY=
# The token of your discord bot
BOT_TOKEN=
# The client id of your discord application
CLIENT_ID=

Register the application commands:

deno task register

With cloudflared installed, create a tunnel:

cloudflared tunnel --url http://localhost:8000

Start the bot:

deno task start

Go to your application dashboard and update the INTERACTIONS ENDPOINT URL to the tunnel url.

https://[your]-[unique]-[tunnel]-[url].trycloudflare.com

Execute the /hello command in your discord server. You should see a hi back. You're good to go! If the bot doesn't respond, check the logs for errors.

license

This project is licensed under the MIT license. See the license for more information.

kiwi's People

Contributors

jabolol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.