mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 00:40:07 +00:00
Merge branch 'master' of https://github.com/Skillz4Killz/Discordeno into next
This commit is contained in:
18
README.md
18
README.md
@@ -7,8 +7,6 @@
|
||||

|
||||
[](https://nest.land/package/Discordeno)
|
||||
|
||||
## Features
|
||||
|
||||
- First-class TypeScript & JavaScript support
|
||||
- Security & stable
|
||||
- Builtin Documentation
|
||||
@@ -32,7 +30,7 @@ If you do not wish to use a boilerplate, you may continue reading.
|
||||
Here's a minimal example to get started with:
|
||||
|
||||
```typescript
|
||||
import StartBot, { sendMessage, Intents } from "https://x.nest.land/Discordeno@9.0.15/mod.ts";
|
||||
import StartBot, { sendMessage, Intents } from "https://x.nest.land/Discordeno@9.4.0/mod.ts";
|
||||
|
||||
StartBot({
|
||||
token: "BOT TOKEN",
|
||||
@@ -54,6 +52,18 @@ StartBot({
|
||||
- [Support server](https://discord.gg/J4NqJ72)
|
||||
- [Contributing Guide](https://github.com/Skillz4Killz/Discordeno/blob/master/.github/CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
## Contributing
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
Discordeno expects participants to adhere to our [Code of Conduct](https://github.com/Skillz4Killz/Discordeno/blob/master/.github/CODE_OF_CONDUCT.md).
|
||||
|
||||
## Contributing Guide
|
||||
|
||||
We appreciate your help!
|
||||
|
||||
Before contributing, please read the [Contributing Guide](https://github.com/Skillz4Killz/Discordeno/blob/master/.github/CONTRIBUTING.md).
|
||||
|
||||
### License
|
||||
|
||||
[MIT © Skillz4Killz](https://github.com/Skillz4Killz/Discordeno/blob/master/LICENSE)
|
||||
|
||||
@@ -565,7 +565,7 @@ export async function ban(guildID: string, id: string, options: BanOptions) {
|
||||
);
|
||||
}
|
||||
|
||||
/** Remove the ban for a user. REquires BAN_MEMBERS permission */
|
||||
/** Remove the ban for a user. Requires BAN_MEMBERS permission */
|
||||
export async function unban(guildID: string, id: string) {
|
||||
const hasPerm = await botHasPermission(guildID, ["BAN_MEMBERS"]);
|
||||
if (!hasPerm) {
|
||||
|
||||
@@ -2,10 +2,19 @@ import { Unpromise } from "../types/misc.ts";
|
||||
import { RoleData } from "../types/role.ts";
|
||||
|
||||
export async function createRole(data: RoleData) {
|
||||
const { tags, ...rest } = data;
|
||||
|
||||
const roleTags = {
|
||||
botID: tags?.bot_id,
|
||||
premiumSubscriber: "premium_subscriber" in (tags ?? {}),
|
||||
integrationID: tags?.integration_id,
|
||||
};
|
||||
|
||||
return {
|
||||
...data,
|
||||
...rest,
|
||||
/** The @ mention of the role in a string. */
|
||||
mention: `<@&${data.id}>`,
|
||||
tags: roleTags,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -15,4 +15,15 @@ export interface RoleData {
|
||||
managed: boolean;
|
||||
/** whether this role is mentionable */
|
||||
mentionable: boolean;
|
||||
/** Certain roles may have tags that allow you to determine if this role is related to a bot, an integration, or the booster role. */
|
||||
tags: RoleTags | null;
|
||||
}
|
||||
|
||||
export interface RoleTags {
|
||||
/** the id of the bot who has this role */
|
||||
bot_id?: string;
|
||||
/** whether this is the premium subscriber role for this guild */
|
||||
premium_subscriber?: null;
|
||||
/** the id of the integration this role belongs to */
|
||||
integration_id?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user