Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dysnomia port #12

Merged
merged 70 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
a9ad12f
fix(voice): re-add receive listener on connect (#1332)
jimchen5209 Jun 5, 2022
f7a8e50
fix(getAllUsers): request presences if intent is enabled (#1378)
A5rocks Jun 5, 2022
d0099b1
chore(Base): document props, static methods (#1380)
eritbh Jun 5, 2022
b8dcd62
fix(Guild#editCommandPermissions): fix alias typo (#1350)
Chris8889 Mar 13, 2022
e888253
fix(getGuildAuditLog): cache users & threads earlier (#1367)
DonovanDMC Jun 5, 2022
a2e3a00
fix(messageUpdate): fix oldMessage#mentions type (#1377)
DonovanDMC Jun 5, 2022
162d4ef
fix(joinVoiceChannel): skip permission check if Member uncached (#1383)
abalabahaha Jun 5, 2022
05a932a
fix(ShardManager): refactor concurrency check, add option (#1382)
abalabahaha Jun 5, 2022
a2a60a5
fix(createRole): split options into separate overloads (#1376)
DonovanDMC Jun 7, 2022
fe16a8f
feat(getGuildBans): support pagination (#1363)
HeadTriXz Jun 7, 2022
99b1376
feat(editChannelPositions): add support for endpoint (#1328)
Jun 7, 2022
ba4cb94
fix(editChannel): fix `videoQualityMode` & add `permissionOverwrites`…
aicushman Jun 8, 2022
bd58677
feat(connect): add token check (#1283)
JustCat80 Jun 8, 2022
f886ebc
feat(Client): allow custom numbers in intents option (#1388)
HcgRandon Jun 29, 2022
c7689d0
feat(interactions): Add support for appPermissions (#1394)
frobinsonj Jun 30, 2022
34cd985
fix(Client): remove optional chaining from 05a932a
abalabahaha Jun 30, 2022
bd2b0f1
0.17.1
abalabahaha Jun 30, 2022
4ea56e4
chore: bump dev version to 0.17.2-dev
abalabahaha Jun 30, 2022
eb40373
feat(Member): Add dynamicAvatarURL (#1411)
eritbh Aug 16, 2022
fcc6636
feat(permissions): Slash Permissions v2 (PR 1372)
coolcalcacol Sep 16, 2022
5f2ed44
Attachment type (PR 1358)
coolcalcacol Sep 16, 2022
80a8b89
Remove all user account features (PR 1338)
bsian03 Sep 16, 2022
61b9502
refactor(interactions): Interactions Refactor (PR 1309)
DonovanDMC Sep 16, 2022
47d88db
feat(interactions): Support Modals (PR 1404)
DonovanDMC Sep 16, 2022
d1354eb
Use process warnings for deprecations (PR 1276)
eritbh Sep 16, 2022
c1bbcc4
Guild Scheduled Events (PR 1275)
Loliticos Sep 16, 2022
ec7dca1
Follow http/https redirects when playing song (PR 494)
macdja38 Jun 11, 2019
4393e2a
Return void on 204 (PR 1021)
bsian03 Sep 21, 2020
d3b5c67
Allow configuring RequestHandler to use HTTP instead of HTTPS (PR 1193)
molenzwiebel May 1, 2021
132b876
Standardized parsing errors (PR 1227)
LJNeon Jun 25, 2021
5770311
feat(gateway): Use New Resume URL (PR 1410)
DonovanDMC Oct 6, 2022
18deb89
refactor: remove StoreChannels (PR 1405)
DonovanDMC Oct 6, 2022
b2c86a6
feat(bans): Seconds Support (PR 1397)
DonovanDMC Oct 6, 2022
7094c4f
feat(AutoModeration): Support Auto Moderation (PR 1390)
DonovanDMC Oct 6, 2022
b5f70bb
feat(options): Gateway Options (PR 1384)
DonovanDMC Oct 6, 2022
91d29f9
refactor: Overall Consistency Fixes & Minor Feature Additions (PR 1379)
DonovanDMC Oct 6, 2022
205ddce
fix(CommandClient): await permission checks (PR 1414)
YalphaFR Oct 6, 2022
2c33417
feat: API v10 (PR 1371)
coolcalcacol Oct 6, 2022
25d753d
chore: rebrand to Project Dysnomia
TTtie Oct 9, 2022
4b53d44
lint
TTtie Oct 9, 2022
a594109
fix: use ./* for exports
TTtie Oct 9, 2022
b65af6c
chore: rename forgotten references to Eris (#2)
TTtie Oct 11, 2022
75d58b7
chore: remove deprecated/dead code (#3)
TTtie Oct 14, 2022
28f5a87
feat: entity select types (#4)
TTtie Oct 14, 2022
5c7bde8
chore(examples/intent): fix import typo (#6)
Oct 21, 2022
826b671
chore: update example in README.md (#7)
TTtie Oct 21, 2022
4456255
feat: modern file uploading (#5)
TTtie Oct 23, 2022
0d6e138
fixup(Client): oops :( make _processAttachments return the expected s…
TTtie Oct 23, 2022
8b3bbda
feat(automoderation): support new trigger metadata (#9)
TTtie Nov 11, 2022
a1368b0
feat(Constants): add ACTIVE_DEVELOPER user flag (#10)
TTtie Nov 11, 2022
b3fda21
feat: forum support (#1)
TTtie Nov 28, 2022
131a14a
Attachment#proxyUrl -> Attachment#proxyURL (#11)
TTtie Nov 28, 2022
d2d5da8
fix(Client): do not send the file buffer twice (#13)
TTtie Nov 30, 2022
e4681e6
feat(Guild): automatically populate events on GUILD_CREATE (#12)
TTtie Nov 30, 2022
ccc03b9
feat(ForumChannel): `default_forum_layout` (#14)
TTtie Dec 14, 2022
22a12e7
chore: update dev dependencies and lint (#15)
TTtie Dec 14, 2022
ff9a4db
chore: remove editGuildVanity (#18)
TTtie Dec 16, 2022
80af5c7
feat(ApplicationCommand): support NSFW commands (#16)
TTtie Dec 17, 2022
13d56c0
docs: document audit log after parameter (#20)
TTtie Jan 7, 2023
cf0a9f1
fix(Constants): wrong ACTIVE_DEVELOPER bit (╯°□°)╯︵ ┻━┻ (#23)
TTtie Jan 7, 2023
651078b
feat: add new message types (#22)
TTtie Jan 8, 2023
a61d849
feat: add GIF as a supported sticker format (#24)
TTtie Jan 10, 2023
f388db4
feat: linked roles (#19)
TTtie Jan 11, 2023
0aa9d72
feat(ThreadChannel): thread member pagination (#25)
TTtie Jan 13, 2023
f36466e
feat: role subscriptions (#21)
TTtie Jan 14, 2023
558fdc6
fix(ThreadMember): missing Member import (#27)
TTtie Jan 14, 2023
15ebb0c
feat(Client): add threadID support to editWebhookMessage (#28)
Cynosphere Jan 22, 2023
008d5fa
fix(ShardManager): correctly emit warning on invalid intent (#29)
Snazzah Feb 4, 2023
e50d99c
fix(ForumChannel): document and handle nullability of certain fields
TTtie Jan 22, 2023
077e4ae
Merge branch 'dev' of https://github.com/projectdysnomia/dysnomia int…
Brainicism Feb 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ Thanks for considering contributing!

A few rules of thumb:
- Code contributions should match the existing code style. `npm run lint:js` and `npm run lint:ts` could help you check
- Discuss additions/changes with us [on Discord](https://abal.moe/Eris/invite) before working on them
- Discuss additions/changes with us [on Discord](https://discord.gg/2uUvgJzgCE) before working on them
- Check the dev branch to make sure someone hasn't worked on the same thing already
- Pull requests should point to the dev branch, not master
- Pull requests should point to the dev branch.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)

Copyright (c) 2016-2021 abalabahaha
Copyright (c) 2022- Project Dysnomia Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
Eris [![NPM version](https://img.shields.io/npm/v/eris.svg?style=flat-square&color=informational)](https://npmjs.com/package/eris)
Project Dysnomia
====

A Node.js wrapper for interfacing with Discord.
A fork of [Eris](https://github.com/abalabahaha/eris), a Node.js wrapper for interfacing with Discord, focused on keeping up with the latest Discord API changes.

Installing
----------

You will need NodeJS 10.4+. If you need voice support you will also need Python 2.7 and a C++ compiler. Refer to [the Getting Started section of the docs](https://abal.moe/Eris/docs) for more details.
You will need NodeJS 10.4+. Voice support requires [additional software](https://github.com/nodejs/node-gyp#installation).

```
npm install --no-optional eris
npm install --no-optional @projectdysnomia/dysnomia
```

If you'd like to install the development versions of the library, use the following command instead:
```
npm install --no-optional github:projectdysnomia/dysnomia#dev
```

If you need voice support, remove the `--no-optional`.
Expand All @@ -18,13 +23,15 @@ Ping Pong Example
-----------------

```js
const Eris = require("eris");
const Dysnomia = require("@projectdysnomia/dysnomia");

// Replace TOKEN with your bot account's token
const bot = new Eris("Bot TOKEN", {
intents: [
"guildMessages"
]
const bot = new Dysnomia("Bot TOKEN", {
gateway: {
intents: [
"guildMessages"
]
}
});

bot.on("ready", () => { // When the bot is ready
Expand All @@ -48,15 +55,14 @@ bot.on("messageCreate", (msg) => { // When a message is created
bot.connect(); // Get the bot to connect to Discord
```

More examples can be found in [the examples folder](https://github.com/abalabahaha/eris/tree/master/examples).
More examples can be found in [the examples folder](https://github.com/projectdysnomia/dysnomia/tree/master/examples).

Useful Links
------------

- [The website](https://abal.moe/Eris/) has more details and documentation.
- [The official Eris server](https://abal.moe/Eris/invite) is the best place to get support.
- [The GitHub repo](https://github.com/abalabahaha/eris) is where development primarily happens.
- [The NPM package webpage](https://npmjs.com/package/eris) is, well, the webpage for the NPM package.
- [The official Project Dysnomia server](https://discord.gg/2uUvgJzgCE) is the best place to get support.
- [The GitHub repo](https://github.com/projectdysnomia/dysnomia) is where development primarily happens.
- [The NPM package webpage](https://npmjs.com/package/@projectdysnomia/dysnomia) is, well, the webpage for the NPM package.

License
-------
Expand Down
15 changes: 7 additions & 8 deletions esm.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import Eris from "./index.js";
import Dysnomia from "./index.js";

export default function(token, options) {
return new Eris.Client(token, options);
return new Dysnomia.Client(token, options);
}

export const {
ApplicationCommand,
Attachment,
AutocompleteInteraction,
Base,
Bucket,
Call,
CategoryChannel,
Channel,
Client,
Expand All @@ -21,16 +22,17 @@ export const {
DiscordHTTPError,
DiscordRESTError,
ExtendedUser,
GroupChannel,
Guild,
GuildChannel,
GuildIntegration,
GuildPreview,
GuildScheduledEvent,
GuildTemplate,
Interaction,
Invite,
Member,
Message,
ModalSubmitInteraction,
NewsChannel,
NewsThreadChannel,
Permission,
Expand All @@ -39,25 +41,22 @@ export const {
PrivateChannel,
PrivateThreadChannel,
PublicThreadChannel,
Relationship,
RequestHandler,
Role,
SequentialBucket,
Shard,
SharedStream,
StageChannel,
StageInstance,
StoreChannel,
TextChannel,
TextVoiceChannel,
ThreadChannel,
ThreadMember,
UnavailableGuild,
UnknownInteraction,
User,
VERSION,
VoiceChannel,
VoiceConnection,
VoiceConnectionManager,
VoiceState
} = Eris;
} = Dysnomia;
14 changes: 7 additions & 7 deletions examples/applicationCommands.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const Eris = require("eris");
const Dysnomia = require("@projectdysnomia/dysnomia");

const Constants = Eris.Constants;
const Constants = Dysnomia.Constants;

// Replace TOKEN with your bot account's token
const bot = new Eris("BOT TOKEN", {
intents: [] //No intents are needed for interactions, but you still need to specify either an empty array or 0
const bot = new Dysnomia("BOT TOKEN", {
gateway: {
intents: [] //No intents are needed for interactions, but you still need to specify either an empty array or 0
}
});

bot.on("ready", async () => { // When the bot is ready
console.log("Ready!"); // Log "Ready!"

//Note: You should use guild commands to test, as they update instantly. Global commands can take up to an hour to update.

const commands = await bot.getCommands();

if(!commands.length) {
Expand Down Expand Up @@ -80,7 +80,7 @@ bot.on("error", (err) => {
});

bot.on("interactionCreate", (interaction) => {
if(interaction instanceof Eris.CommandInteraction) {
if(interaction instanceof Dysnomia.CommandInteraction) {
switch(interaction.data.name) {
case "test_edit_command":
interaction.createMessage("interaction recieved");
Expand Down
6 changes: 3 additions & 3 deletions examples/basicCommands.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const Eris = require("eris");
const Dysnomia = require("@projectdysnomia/dysnomia");

// Replace TOKEN with your bot account's token
const bot = new Eris.CommandClient("Bot TOKEN", {}, {
description: "A test bot made with Eris",
const bot = new Dysnomia.CommandClient("Bot TOKEN", {}, {
description: "A test bot made with Dysnomia",
owner: "somebody",
prefix: "!"
});
Expand Down
12 changes: 7 additions & 5 deletions examples/components.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
const Eris = require("eris");
const Dysnomia = require("@projectdysnomia/dysnomia");

const Constants = Eris.Constants;
const Constants = Dysnomia.Constants;

// Replace TOKEN with your bot account's token
const bot = new Eris("BOT TOKEN", {
intents: ["guildMessages"]
const bot = new Dysnomia("BOT TOKEN", {
gateway: {
intents: ["guildMessages"]
}
});

bot.on("ready", async () => { // When the bot is ready
Expand Down Expand Up @@ -71,7 +73,7 @@ bot.on("messageCreate", (msg) => { // When a message is created
});

bot.on("interactionCreate", (interaction) => {
if(interaction instanceof Eris.ComponentInteraction) {
if(interaction instanceof Dysnomia.ComponentInteraction) {
return interaction.createMessage({
content: "Interaction Recieved",
flags: 64
Expand Down
6 changes: 3 additions & 3 deletions examples/embed.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const Eris = require("eris");
const Dysnomia = require("@projectdysnomia/dysnomia");

// Replace TOKEN with your bot account's token
const bot = new Eris("Bot TOKEN");
const bot = new Dysnomia("Bot TOKEN");

bot.on("ready", () => { // When the bot is ready
console.log("Ready!"); // Log "Ready!"
Expand Down Expand Up @@ -35,7 +35,7 @@ bot.on("messageCreate", (msg) => { // When a message is created
}
],
footer: { // Footer text
text: "Created with Eris."
text: "Created with Dysnomia."
}
}]
});
Expand Down
14 changes: 8 additions & 6 deletions examples/intent.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const Eris = require("eris");
const Dysnomia = require("@projectdysnomia/dysnomia");

// Replace TOKEN with your bot account's token
const bot = new Eris("Bot TOKEN", {
intents: [
"guilds",
"guildMessages"
]
const bot = new Dysnomia("Bot TOKEN", {
gateway: {
intents: [
"guilds",
"guildMessages"
]
}
});

bot.on("ready", () => { // When the bot is ready
Expand Down
4 changes: 2 additions & 2 deletions examples/pingpong.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const Eris = require("eris");
const Dysnomia = require("@projectdysnomia/dysnomia");

// Replace TOKEN with your bot account's token
const bot = new Eris("Bot TOKEN");
const bot = new Dysnomia("Bot TOKEN");

bot.on("ready", () => { // When the bot is ready
console.log("Ready!"); // Log "Ready!"
Expand Down
4 changes: 2 additions & 2 deletions examples/playFile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const Eris = require("eris");
const Dysnomia = require("@projectdysnomia/dysnomia");

// Replace TOKEN with your bot account's token
const bot = new Eris("Bot TOKEN");
const bot = new Dysnomia("Bot TOKEN");

const playCommand = "!play";

Expand Down
6 changes: 3 additions & 3 deletions examples/reactionButtons.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const Eris = require("eris");
const Dysnomia = require("@projectdysnomia/dysnomia");

// Replace TOKEN with your bot account's token
const bot = new Eris.CommandClient("Bot TOKEN", {}, {
description: "A test bot made with Eris",
const bot = new Dysnomia.CommandClient("Bot TOKEN", {}, {
description: "A test bot made with Dysnomia",
owner: "somebody",
prefix: "!"
});
Expand Down
16 changes: 9 additions & 7 deletions examples/sharding.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
const Eris = require("eris");
const Dysnomia = require("@projectdysnomia/dysnomia");

// Replace TOKEN with your bot account's token
const bot = new Eris("Bot TOKEN", {
firstShardID: 0,
lastShardID: 15,
maxShards: 16,
getAllUsers: false,
intents: ["guilds", "guildMembers", "guildPresences"]
const bot = new Dysnomia("Bot TOKEN", {
gateway: {
firstShardID: 0,
lastShardID: 15,
maxShards: 16,
getAllUsers: false,
intents: ["guilds", "guildMembers", "guildPresences"]
}
});

bot.on("ready", () => { // When the bot is ready
Expand Down
Loading