Merge remote-tracking branch 'origin/main' into slash
This commit is contained in:
commit
df66f4ea3e
13 changed files with 29 additions and 26 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -114,4 +114,7 @@ src/test/config.ts
|
|||
# macOS is shit xD
|
||||
**/.DS_Store
|
||||
|
||||
src/test/music.mp3
|
||||
# Webstorm dont forget this duude :)
|
||||
.idea/
|
||||
|
||||
src/test/music.mp3
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "harmony",
|
||||
"version": "0.9.2",
|
||||
"version": "0.9.3",
|
||||
"description": "Discord Deno API that is easy to use.",
|
||||
"main": "mod.ts",
|
||||
"repository": "https://github.com/harmony-org/harmony.git",
|
||||
|
|
|
@ -196,7 +196,7 @@ export interface ClientEvents {
|
|||
/**
|
||||
* A Guild Member was updated. Nickname changed, role assigned, etc.
|
||||
* @param before Member object before update
|
||||
* @param after Meber object after update
|
||||
* @param after Member object after update
|
||||
*/
|
||||
guildMemberUpdate: [before: Member, after: Member]
|
||||
/**
|
||||
|
|
|
@ -76,7 +76,7 @@ export class DefaultCacheAdapter implements ICacheAdapter {
|
|||
}
|
||||
}
|
||||
|
||||
/** Redis Cache Adatper for using Redis as a cache-provider. */
|
||||
/** Redis Cache Adapter for using Redis as a cache-provider. */
|
||||
export class RedisCacheAdapter implements ICacheAdapter {
|
||||
_redis: Promise<Redis>
|
||||
redis?: Redis
|
||||
|
|
|
@ -18,7 +18,7 @@ export interface CommandContext {
|
|||
channel: TextChannel
|
||||
/** Prefix which was used */
|
||||
prefix: string
|
||||
/** Oject of Command which was used */
|
||||
/** Object of Command which was used */
|
||||
command: Command
|
||||
/** Name of Command which was used */
|
||||
name: string
|
||||
|
|
|
@ -67,7 +67,7 @@ export class Extension {
|
|||
description?: string
|
||||
/** Extensions's Commands Manager */
|
||||
commands: ExtensionCommands = new ExtensionCommands(this)
|
||||
/** Sub-Prefix to be used for ALL of Extenion's Commands. */
|
||||
/** Sub-Prefix to be used for ALL of Extension's Commands. */
|
||||
subPrefix?: string
|
||||
/** Events registered by this Extension */
|
||||
events: { [name: string]: (...args: any[]) => {} } = {}
|
||||
|
|
|
@ -7,7 +7,7 @@ import { RESTManager } from './rest.ts'
|
|||
|
||||
// TODO(DjDeveloperr)
|
||||
// I'm kinda confused; will continue on this later once
|
||||
// Deno namespace in Web Woker is stable!
|
||||
// Deno namespace in Web Worker is stable!
|
||||
export interface ShardManagerOptions {
|
||||
client: Client | typeof Client
|
||||
token?: string
|
||||
|
|
|
@ -164,7 +164,7 @@ export class Member extends Base {
|
|||
/**
|
||||
* Bans the Member.
|
||||
* @param reason Reason for the Ban.
|
||||
* @param deleteMessagesDays Delete Old Messages? If yes, how much days.
|
||||
* @param deleteOldMessages Delete Old Messages? If yes, how much days.
|
||||
*/
|
||||
async ban(reason?: string, deleteOldMessages?: number): Promise<void> {
|
||||
return this.guild.bans.add(this.id, reason, deleteOldMessages)
|
||||
|
|
|
@ -17,7 +17,7 @@ export default class AddEmojiCommand extends Command {
|
|||
.then((emoji) => {
|
||||
if (emoji === undefined) throw new Error('Unknown')
|
||||
ctx.message.reply(
|
||||
`Successfuly added emoji ${emoji.toString()} ${emoji.name}!`
|
||||
`Successfully added emoji ${emoji.toString()} ${emoji.name}!`
|
||||
)
|
||||
})
|
||||
.catch((e) => {
|
||||
|
|
|
@ -265,7 +265,7 @@ export interface MessageActivity {
|
|||
export interface MessageApplication {
|
||||
id: string
|
||||
cover_image?: string
|
||||
desription: string
|
||||
description: string
|
||||
icon: string | undefined
|
||||
name: string
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ const GUILD_INTEGRATION = (guildID: string, integrationID: string): string =>
|
|||
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/guilds/${guildID}/integrations/${integrationID}`
|
||||
const GUILD_INTEGRATIONS = (guildID: string): string =>
|
||||
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/guilds/${guildID}/integrations`
|
||||
const GUILD_INTEGARTION_SYNC = (guildID: string): string =>
|
||||
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/guilds/${guildID}/integrations?include_appilications=true`
|
||||
const GUILD_INTEGRATIONS_SYNC = (guildID: string): string =>
|
||||
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/guilds/${guildID}/integrations?include_applications=true`
|
||||
const GUILD_BAN = (guildID: string, userID: string): string =>
|
||||
`${DISCORD_API_URL}/v${DISCORD_API_VERSION}/guilds/${guildID}/bans/${userID}`
|
||||
const GUILD_BANS = (guildID: string): string =>
|
||||
|
@ -229,7 +229,7 @@ export {
|
|||
GUILD_ROLES,
|
||||
GUILD_INTEGRATION,
|
||||
GUILD_INTEGRATIONS,
|
||||
GUILD_INTEGARTION_SYNC,
|
||||
GUILD_INTEGRATIONS_SYNC,
|
||||
GUILD_WIDGET_IMAGE,
|
||||
GUILD_BAN,
|
||||
GUILD_BANS,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/** Delay by `ms` miliseconds */
|
||||
/** Delay by `ms` milliseconds */
|
||||
export const delay = async (ms: number): Promise<true> =>
|
||||
await new Promise((resolve, reject) => {
|
||||
setTimeout(() => resolve(true), ms)
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { GatewayIntents } from '../types/gateway.ts'
|
||||
|
||||
export type PriviligedIntents = 'GUILD_MEMBERS' | 'GUILD_PRESENCES'
|
||||
export type PrivilegedIntents = 'GUILD_MEMBERS' | 'GUILD_PRESENCES'
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-extraneous-class */
|
||||
/** Utility class for handling Gateway Intents */
|
||||
export class Intents {
|
||||
static NonPriviliged: number[] = [
|
||||
static NonPrivileged: number[] = [
|
||||
GatewayIntents.GUILD_MESSAGES,
|
||||
GatewayIntents.DIRECT_MESSAGES,
|
||||
GatewayIntents.DIRECT_MESSAGE_REACTIONS,
|
||||
|
@ -24,32 +24,32 @@ export class Intents {
|
|||
static All: number[] = [
|
||||
GatewayIntents.GUILD_MEMBERS,
|
||||
GatewayIntents.GUILD_PRESENCES,
|
||||
...Intents.NonPriviliged
|
||||
...Intents.NonPrivileged
|
||||
]
|
||||
|
||||
static Presence: number[] = [
|
||||
GatewayIntents.GUILD_PRESENCES,
|
||||
...Intents.NonPriviliged
|
||||
...Intents.NonPrivileged
|
||||
]
|
||||
|
||||
static GuildMembers: number[] = [
|
||||
GatewayIntents.GUILD_MEMBERS,
|
||||
...Intents.NonPriviliged
|
||||
...Intents.NonPrivileged
|
||||
]
|
||||
|
||||
static None: number[] = [...Intents.NonPriviliged]
|
||||
static None: number[] = [...Intents.NonPrivileged]
|
||||
|
||||
/** Create an Array of Intents easily passing Intents you're priviliged for and disable the ones you don't need */
|
||||
/** Create an Array of Intents easily passing Intents you're privileged for and disable the ones you don't need */
|
||||
static create(
|
||||
priviliged?: PriviligedIntents[],
|
||||
privileged?: PrivilegedIntents[],
|
||||
disable?: number[]
|
||||
): number[] {
|
||||
let intents: number[] = [...Intents.NonPriviliged]
|
||||
let intents: number[] = [...Intents.NonPrivileged]
|
||||
|
||||
if (priviliged !== undefined && priviliged.length !== 0) {
|
||||
if (priviliged.includes('GUILD_MEMBERS'))
|
||||
if (privileged !== undefined && privileged.length !== 0) {
|
||||
if (privileged.includes('GUILD_MEMBERS'))
|
||||
intents.push(GatewayIntents.GUILD_MEMBERS)
|
||||
if (priviliged.includes('GUILD_PRESENCES'))
|
||||
if (privileged.includes('GUILD_PRESENCES'))
|
||||
intents.push(GatewayIntents.GUILD_PRESENCES)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue