Code Monkey home page Code Monkey logo

wheel-of-names-discord-bot's Introduction

Wheel of names - Discord bot

A wheel of names bot build with discord.js

Introduction

This bot generates a dynamic spin wheel gif with the options specified as arguments. It uses the canvas and gifencoder packages to create the spin wheel GIF.

Example

How to use

  1. Install the packages with npm install.
  2. Get your Discord bot token and configure it in your server. Configure the bot with MESSAGE CONTENT INTENT and Send Message permission.
  3. To start the bot use: TOKEN=yourtoken yarn start or TOKEN=yourtoken yarn dev if you need hot reload.

Available commands

  • !pick: this command creates the spin wheel with the options passed as arguments separated by commas.

    Example: !pick option1,option2,option3,option4

Limitations

The Discord API does not allow to modify the files embedded in a message, so it is necessary to delete and send another message. This produces a strange effect, but it works ๐Ÿ˜„

wheel-of-names-discord-bot's People

Contributors

pbr1111 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wheel-of-names-discord-bot's Issues

Segmentation fault and malloc(): smallbin double linked list corrupted

Hi,
I really like what you did here, but I have a problem. When trying to run this on my raspberry pi, I always get an error. Sometimes it is just a segmentation fault and sometimes it is malloc(): smallbin double linked list corrupted. Do you have an idea what's causing this error?
Thanks in advance!

Not working!

> start
> tsc -p . && node dist/bot.js

src/bot/commands/pick/canvas-wheel.ts:1:18 - error TS2305: Module '"canvas"' has no exported member 'NodeCanvasRenderingContext2D'.

1 import { Canvas, NodeCanvasRenderingContext2D } from 'canvas';
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

src/bot/commands/pick/spin-wheel.ts:28:22 - error TS2345: Argument of type 'import("C:/Users/Unbloated/Desktop/wheel-of-names-discord-bot-main/node_modules/canvas/types/index").CanvasRenderingContext2D' is not assignable to parameter of type 'CanvasRenderingContext2D'.
  Type 'CanvasRenderingContext2D' is missing the following properties from type 'CanvasRenderingContext2D': isPointInStroke, filter, imageSmoothingQuality, direction, and 2 more.

28     encoder.addFrame(ctx);
                        ~~~

src/bot/commands/pick/spin-wheel.ts:32:22 - error TS2345: Argument of type 'import("C:/Users/Unbloated/Desktop/wheel-of-names-discord-bot-main/node_modules/canvas/types/index").CanvasRenderingContext2D' is not assignable to parameter of type 'CanvasRenderingContext2D'.

32     encoder.addFrame(ctx);
                        ~~~


Found 3 errors.

Any idea? ;-;

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.