Git Product home page Git Product logo

add-to-playlist's Introduction

/create with Cloudflare Workers

A slash-create template, using Cloudflare Workers.

Deploy to Cloudflare Workers

Getting Started

Cloning the repo

You can either use degit to locally clone this repo without git, or create a new repo from this template and clone that.

npx degit Snazzah/slash-create-worker

After that, make sure to install dependencies using npm or yarn:

npm install
# yarn

Installing and setting up Wrangler

Make sure to sign up for a Cloudflare Workers account in a browser before continuing. Install wrangler with npm or yarn:

npm install -D wrangler@latest
# yarn global add wrangler@latest

Read more about installing wrangler.

Afterwards, run wrangler login to login to your Cloudflare account with OAuth:

wrangler login

Copy wrangler.example.toml into wrangler.toml. Make sure to fill in your account ID in the config and update the name of the worker. You can find your account ID here towards the right side.

Filling in secrets

You can enter in environment secrets with wrangler secret put, here are the keys that are required to run this:

npx wrangler secret put DISCORD_APP_ID
npx wrangler secret put DISCORD_PUBLIC_KEY
npx wrangler secret put DISCORD_BOT_TOKEN

Development

To run this locally, copy .env.example to .dev.vars and fill in the variables, then you can run npm run dev (or yarn dev) to start a local dev environment and use something like ngrok to tunnel it to a URL.

To sync commands in the development environment, copy .env.example to development.env and fill in the variables, then run npm run sync:dev (or yarn sync:dev).

Note: When you create a command, make sure to include it in the array of commands in ./src/commands/index.ts.

Production

To sync to production, copy .env.example to .env and fill in the variables, then run npm run sync. To publish code to a worker, run npm run deploy.

add-to-playlist's People

Contributors

chromadream 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.