0.0.3 • Published 4 years ago

@argon-framework/core v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@argon/core

THIS IS A WIP, AND PROBABLY VERY BROKEN IMPLEMENTATION OF THE DISCORD API! NOT RECOMMENDED FOR PRODUCTION USE!

With that warning said; Here is an example with using the experimental slash commands api.

Note: for the event, there is no typedefs at the moment until I add caching. Sorry for the inconvenience. What is being sent can be checked here

Typescript
import Discord from '@argon-framework/core';

const client = new Discord.Client({
	experimentalFeatures: {
		slashCommands: true,
	}
});

client.login('BOT TOKEN HERE!');

// THIS MUST GO BELOW LOGIN! This will be fixed in a later release.
// `botID` is required until I add caching. Sorry about that.
client.createSlashCommand('BOT ID', {
	"name": "blep",
	"description": "Send a random adorable animal photo",
	"options": [
		{
			"name": "animal",
			"description": "The type of animal",
			"type": 3,
			"required": True,
			"choices": [
				{
					"name": "Dog",
					"value": "animal_dog"
				},
				{
					"name": "Cat",
					"value": "animal_dog"
				},
				{
					"name": "Penguin",
					"value": "animal_penguin"
				}
			]
		},
		{
			"name": "only_smol",
			"description": "Whether to show only baby animals",
			"type": 5,
			"required": False
		}
	]
});

client.on('interactionCreate', (data) => {
	console.log(data);
});
Javascript
const Discord = require('@argon-framework/core');

const client = new Discord.Client({
	experimentalFeatures: {
		slashCommands: true,
	}
});

client.login('BOT TOKEN HERE!');

// THIS MUST GO BELOW LOGIN! This will be fixed in a later release.
// `botID` is required until I add caching. Sorry about that.
client.createSlashCommand('BOT ID', {
	"name": "blep",
	"description": "Send a random adorable animal photo",
	"options": [
		{
			"name": "animal",
			"description": "The type of animal",
			"type": 3,
			"required": True,
			"choices": [
				{
					"name": "Dog",
					"value": "animal_dog"
				},
				{
					"name": "Cat",
					"value": "animal_dog"
				},
				{
					"name": "Penguin",
					"value": "animal_penguin"
				}
			]
		},
		{
			"name": "only_smol",
			"description": "Whether to show only baby animals",
			"type": 5,
			"required": False
		}
	]
});

client.on('interactionCreate', (data) => {
	console.log(data);
});

Contributing

Notice any regressions, bugs etc or just want to add a new feature? Feel free to make a PR, describing what you have done and it will be considered. Read CONTRIBUTING.md for more info.

Support Server

Coming Soon!

Roadmap

This list is in no way definitive and only shows what big thing is coming!

  • Create JSON Library
  • Caching
  • Actual events
  • Add all API endpoints
  • Redo REST
0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

5 years ago