Skip to content

Commit bd0790d

Browse files
author
oceanroleplay
committed
fixed import sort
1 parent 99c646a commit bd0790d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+222
-187
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
node_modules

.eslintrc

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"rules": {
1010
"semi": "error",
1111
"quotes": "error",
12+
"sort-imports": "error",
1213
"@typescript-eslint/no-empty-function": "warn",
1314
"@typescript-eslint/no-unused-vars": "warn",
1415
"@typescript-eslint/no-empty-interface": "warn",

docs/src/components/HomepageFeatures.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const FeatureList = [
1919
},
2020
];
2121

22-
function Feature({ Svg, title, description }) {
22+
function Feature({ title, description }) {
2323
return (
2424
<div className={clsx("col col--4")}>
2525
<div className="text--center padding-horiz--md">

docs/src/pages/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React from "react";
2-
import clsx from "clsx";
1+
import HomepageFeatures from "../components/HomepageFeatures";
32
import Layout from "@theme/Layout";
43
import Link from "@docusaurus/Link";
5-
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
4+
import React from "react";
5+
import clsx from "clsx";
66
import styles from "./index.module.css";
7-
import HomepageFeatures from "../components/HomepageFeatures";
7+
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
88

99
function HomepageHeader() {
1010
const { siteConfig } = useDocusaurusContext();

examples/button/discords/AppDiscord.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import {
2-
CommandInteraction,
3-
MessageButton,
4-
MessageActionRow,
5-
ButtonInteraction,
6-
EmojiIdentifierResolvable,
7-
} from "discord.js";
8-
import {
2+
ButtonComponent,
93
Discord,
104
Slash,
11-
ButtonComponent,
12-
SlashOption,
135
SlashChoice,
6+
SlashOption,
147
} from "../../../src";
8+
import {
9+
ButtonInteraction,
10+
CommandInteraction,
11+
EmojiIdentifierResolvable,
12+
MessageActionRow,
13+
MessageButton,
14+
} from "discord.js";
1515
import { randomInt } from "crypto";
1616

1717
enum spcChoice {

examples/command/discords/AppDiscord.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { Channel } from "diagnostics_channel";
2-
import { Role, User } from "discord.js";
31
import {
2+
DefaultPermission,
43
Discord,
4+
Permission,
55
SimpleCommand,
6-
SimpleCommandOption,
76
SimpleCommandMessage,
8-
DefaultPermission,
9-
Permission,
7+
SimpleCommandOption,
108
} from "../../../src";
9+
import { Role, User } from "discord.js";
10+
import { Channel } from "diagnostics_channel";
1111

1212
@Discord()
1313
export abstract class commandTest {

examples/command/discords/simple commands.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { Role, User } from "discord.js";
21
import {
32
Discord,
43
SimpleCommand,
54
SimpleCommandMessage,
65
SimpleCommandOption,
76
} from "../../../src";
7+
import { Role, User } from "discord.js";
88

99
@Discord()
1010
export abstract class commandTest {

examples/contextmenu/discords/AppDiscord.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Discord, ContextMenu } from "../../../src";
1+
import { ContextMenu, Discord } from "../../../src";
22

33
@Discord()
44
export abstract class contextTest {

examples/event/discords/AppDiscord.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable @typescript-eslint/no-unused-vars */
2-
import { Discord, On, Client, ArgsOf } from "../../../src";
2+
import { ArgsOf, Client, Discord, On } from "../../../src";
33

44
@Discord()
55
export abstract class AppDiscord {

examples/guards/Main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Intents } from "discord.js";
21
import { Client } from "../../src";
2+
import { Intents } from "discord.js";
33

44
export class Main {
55
private static _client: Client;

examples/guards/discords/AppDiscord.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { ArgsOf, Client, Discord, Guard, On, Slash } from "../../../src";
12
import { CommandInteraction } from "discord.js";
2-
import { Discord, On, Client, ArgsOf, Guard, Slash } from "../../../src";
33
import { NotBot } from "../guards/NotBot";
44

55
@Discord()

examples/guards/guards/NotBot.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import { ArgsOf, GuardFunction } from "../../../src";
12
import {
23
CommandInteraction,
34
Message,
45
MessageReaction,
56
VoiceState,
67
} from "discord.js";
7-
import { ArgsOf, GuardFunction } from "../../../src";
88

99
// Example by @AndyClausen
1010

examples/menu/discords/AppDiscord.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
22
CommandInteraction,
33
MessageActionRow,
4-
SelectMenuInteraction,
54
MessageSelectMenu,
5+
SelectMenuInteraction,
66
} from "discord.js";
7-
import { Discord, Slash, SelectMenuComponent } from "../../../src";
7+
import { Discord, SelectMenuComponent, Slash } from "../../../src";
88

99
const roles = [
1010
{ label: "Principal", value: "principal" },

examples/multiple-discord-instances/Main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { Intents } from "discord.js";
21
import { Client } from "../../src";
2+
import { Intents } from "discord.js";
33

44
export class Main {
55
private static _client: Client;

examples/slash/discords/AppDiscord.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { CommandInteraction } from "discord.js";
21
import {
32
Discord,
43
Slash,
5-
SlashOption,
6-
SlashGroup,
74
SlashChoice,
5+
SlashGroup,
6+
SlashOption,
87
} from "../../../src";
8+
import { CommandInteraction } from "discord.js";
99

1010
enum TextChoices {
1111
Hello = "Hello",

src/Client.ts

+11-13
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,21 @@ import {
88
Snowflake,
99
} from "discord.js";
1010
import {
11-
MetadataStorage,
1211
ClientOptions,
13-
DiscordEvents,
14-
DOn,
15-
GuardFunction,
16-
} from ".";
17-
import {
18-
DComponentButton,
19-
DDiscord,
12+
DApplicationCommand,
2013
DApplicationCommandOption,
14+
DComponentButton,
2115
DComponentSelectMenu,
22-
DApplicationCommand,
16+
DDiscord,
17+
DOn,
18+
DSimpleCommand,
2319
DSimpleCommandOption,
24-
} from "./decorators";
25-
import { DSimpleCommand } from "./decorators";
26-
import { GuildNotFoundError } from "./errors";
27-
import { SimpleCommandMessage } from "./classes";
20+
DiscordEvents,
21+
GuardFunction,
22+
GuildNotFoundError,
23+
MetadataStorage,
24+
SimpleCommandMessage,
25+
} from ".";
2826

2927
/**
3028
* Extend original client class of discord.js

src/classes/SimpleCommandMessage.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { DSimpleCommand } from "../decorators";
12
import { Message } from "discord.js";
23
import { MetadataStorage } from "..";
3-
import { DSimpleCommand } from "../decorators";
44

55
export class SimpleCommandMessage {
66
prefix: string;

src/decorators/classes/DApplicationCommand.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import {
22
ApplicationCommandData,
33
ApplicationCommandPermissionData,
4+
ApplicationCommandType,
45
CommandInteraction,
56
CommandInteractionOption,
67
Snowflake,
7-
ApplicationCommandType,
88
} from "discord.js";
9-
import { DApplicationCommandOption, Client } from "../..";
10-
import { Method } from "./Method";
9+
10+
import { Client, DApplicationCommandOption, Method } from "../..";
1111

1212
export class DApplicationCommand extends Method {
1313
private _name: string;

src/decorators/classes/DApplicationCommandGroup.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { Decorator } from "./Decorator";
2-
import { DApplicationCommandOption } from "./DApplicationCommandOption";
3-
import { DApplicationCommand } from "./DApplicationCommand";
1+
import { DApplicationCommand, DApplicationCommandOption, Decorator } from "..";
42

53
export class DApplicationCommandGroup<
64
InfoType = DApplicationCommand | DApplicationCommandOption

src/decorators/classes/DApplicationCommandOption.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ import {
77
User,
88
VoiceChannel,
99
} from "discord.js";
10-
import { Decorator } from "./Decorator";
10+
1111
import {
12-
DApplicationCommandOptionChoice,
1312
Client,
13+
DApplicationCommandOptionChoice,
14+
Decorator,
15+
OptionType,
1416
OptionValueType,
1517
StringOptionType,
16-
OptionType,
1718
} from "../..";
1819

1920
export class DApplicationCommandOption extends Decorator {

src/decorators/classes/DComponentButton.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
import { Client, Method } from "../..";
12
import { Snowflake } from "discord.js";
2-
import { Client } from "../..";
3-
import { Method } from "./Method";
43

54
export class DComponentButton extends Method {
65
private _id: string;

src/decorators/classes/DComponentSelectMenu.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
import { Client, Method } from "../..";
12
import { Snowflake } from "discord.js";
2-
import { Client } from "../..";
3-
import { Method } from "./Method";
43

54
export class DComponentSelectMenu extends Method {
65
private _id: string;

src/decorators/classes/DDiscord.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
import { Decorator } from "./Decorator";
2-
import { DGuard, DApplicationCommand, DIService, DOn } from "../..";
3-
import { DComponentButton } from "./DComponentButton";
4-
import { DComponentSelectMenu } from "./DComponentSelectMenu";
51
import { ApplicationCommandPermissionData, Snowflake } from "discord.js";
6-
import { DSimpleCommand } from "./DSimpleCommand";
2+
import {
3+
DApplicationCommand,
4+
DComponentButton,
5+
DComponentSelectMenu,
6+
DGuard,
7+
DIService,
8+
DOn,
9+
DSimpleCommand,
10+
Decorator,
11+
} from "../..";
712

813
export class DDiscord extends Decorator {
914
private _name: string;

src/decorators/classes/DGuard.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { Decorator } from "./Decorator";
2-
import { GuardFunction } from "../..";
1+
import { Decorator, GuardFunction } from "../..";
32

43
export class DGuard extends Decorator {
54
protected _fn: GuardFunction;

src/decorators/classes/DOn.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { DiscordEvents } from "../..";
2-
import { Method } from "./Method";
1+
import { DiscordEvents, Method } from "../..";
32

43
export class DOn extends Method {
54
protected _event: DiscordEvents;

src/decorators/classes/DSimpleCommand.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { ApplicationCommandPermissionData, Snowflake } from "discord.js";
2-
import { Client } from "../..";
3-
import { SimpleCommandMessage } from "../../classes";
4-
import { DSimpleCommandOption } from "./DSimpleCommandOption";
5-
import { Method } from "./Method";
2+
import {
3+
Client,
4+
DSimpleCommandOption,
5+
Method,
6+
SimpleCommandMessage,
7+
} from "../..";
68

79
export class DSimpleCommand extends Method {
810
private _description: string;

src/decorators/classes/DSimpleCommandOption.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { SimpleCommandType } from "..";
2-
import { Decorator } from "./Decorator";
1+
import { Decorator, SimpleCommandType } from "..";
32

43
export class DSimpleCommandOption extends Decorator {
54
private _name: string;

src/decorators/classes/Decorator.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DecoratorUtils } from "../../logic";
1+
import { DecoratorUtils } from "../..";
22

33
export class Decorator {
44
protected _classRef!: Record<string, any>;

src/decorators/classes/Method.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { DGuard, Client, DDiscord } from "../..";
2-
import { Decorator } from "./Decorator";
1+
import { Client, DDiscord, DGuard, Decorator } from "../..";
32

43
export abstract class Method extends Decorator {
54
protected _discord!: DDiscord;

src/decorators/classes/Modifier.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { Decorator } from "./Decorator";
2-
import { DecoratorUtils } from "../../logic/utils/DecoratorUtils";
1+
import { Decorator, DecoratorUtils } from "../..";
32

43
export type ModifyFunction<ToModify extends Decorator> = (
54
original: ToModify

src/decorators/decorators/Bot.ts

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
import { MetadataStorage, Modifier } from "../..";
2-
import { ClassMethodDecorator } from "../../types/public/decorators";
3-
import { DComponentButton } from "../classes/DComponentButton";
4-
import { DSimpleCommand } from "../classes/DSimpleCommand";
5-
import { DDiscord } from "../classes/DDiscord";
6-
import { DOn } from "../classes/DOn";
7-
import { DComponentSelectMenu } from "../classes/DComponentSelectMenu";
8-
import { DApplicationCommand } from "../classes/DApplicationCommand";
1+
import {
2+
ClassMethodDecorator,
3+
DApplicationCommand,
4+
DComponentButton,
5+
DComponentSelectMenu,
6+
DDiscord,
7+
DOn,
8+
DSimpleCommand,
9+
MetadataStorage,
10+
Modifier,
11+
} from "../..";
912

1013
/**
1114
* Execute your application command, button, select menu, simple command or event by defined bot when multiple bots are running in the same instance

src/decorators/decorators/ButtonComponent.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1+
import { DComponentButton, MetadataStorage, MethodDecoratorEx } from "../..";
12
import { Snowflake } from "discord.js";
2-
import { MetadataStorage, DComponentButton } from "../..";
3-
import { MethodDecoratorEx } from "../../types/public/decorators";
43

54
/**
65
* Define button interaction handler

src/decorators/decorators/ContextMenu.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { ApplicationCommandType } from "discord.js";
21
import {
3-
MetadataStorage,
4-
DApplicationCommand,
52
ApplicationCommandParams,
3+
DApplicationCommand,
4+
MetadataStorage,
5+
MethodDecoratorEx,
66
} from "../..";
7-
import { MethodDecoratorEx } from "../../types/public/decorators";
7+
import { ApplicationCommandType } from "discord.js";
88

99
/**
1010
* define context menu for your bot

0 commit comments

Comments
 (0)