Skip to content

ayocord-js/ayocord

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

Ayocord is a discord.js typescript framework based on decorators

Documenation

Check our documentation

Installation

npm

npm i ayocord

yarn

yarn add ayocord

Little bit history?

I always write handlers for my bots and it was really boring and sometimes hard
For each commands you must create files
In python discord libraries we're using decorators for solving this problem
One class = one module (cog in python sleng), however I hate python and love TypeScript ecosystem but this way for creating discord bots I like and I decided to create this framework

Features

  • Decorator Based Syntax - use TypeScript decorators and class based way to write your discord bot
    • Interactions - use decorators to interact with discord API in one class
      • Event
      • Slash commands
      • Text commands
      • Autocomplete
    • Views - using for create your rows with callback!
      • Button
      • Select (Role, Channel, User, String)
      • Modal
    • Guards - check permissions before user use your command
      • Guard
    • Jobs - you need to check use subcribes every 20 seconds? This decorators can solve your problem
      • Job
  • Utils - some useful utils for your discord bot (not rich and not poor)
    • Snowflake parser
    • Discohook parser
    • CustomId parser
  • Multi tokens - allow you launch few bots simultaneously

Realesed Features

Launcher

Internal feature

  • DiscordClient
  • DiscordCollector
  • DiscordFactory

Handlers

Internal feature

  • EventHandler
  • InteractionHandler
  • TextCommandHandler

Interaction Decorators

Use this decorators for interact with discord API
There are two ways to use this decorators

Recommended

  • Methods

    • Event
    • Component
    • SlashCommand
    • TextCommand
    • AutoComplete
    • SubCommand

Views

Use this decorators to creating action rows with callback

  • Views
  • Button
  • StringSelect
  • RoleSelect
  • ChannelSelect

Guards

Use this decorator for checking permissions or another stuff before user interact with command or something else

  • Decorators
    • Guard
  • Interfaces
    • CanUse

Job

Use this decorator to repeat action every duration

  • Decorators
    • Job
  • Cache
    • Set jobs
    • Cancel jobs

Modules

  • Decorators
    • Module
  • Lifecycle
    • onEnabled
    • onDisable
  • Module util
    • moduleEnable
    • moduleDisable