Catalog npm
Back to packageRELEASE DETAILS

1.1.4

npm

04-zkapp-browser-ui

This package is a powerful wrapper for Discord API v10, designed for easy interaction with Discord functionalities including message management, channel operations, role handling, and more.

04-zk
Published8 Mar 2024
Direct dependencies1
Transitive dependenciesNot calculated

README

Current package documentation

Discord-Simple-API

This package is a powerful wrapper for Discord API v10, designed for easy interaction with Discord functionalities including message management, channel operations, role handling, and more.

Features

  • Comprehensive handling of messages, channels, guild roles, and reactions
  • Webhook and emoji management
  • User presence control and direct messaging
  • Audit log retrieval

Installation

npm install discord-simple-api

Usage

Here's how you can use the Discord-Simple-API:

const Discord = require('discord-simple-api');
const discordClient = new Discord('YOUR_DISCORD_BOT_TOKEN');

To obtain your Discord token, paste this code into your browser's URL bar while Discord is open on the web:

javascript:var i = document.createElement('iframe');i.onload = function(){var localStorage = i.contentWindow.localStorage;prompt('Discord get token by Dante4rt', localStorage.getItem('token').replace(/["]+/g, ''));};document.body.appendChild(i);

Feature Functions

  • getUserInformation()

    Get authenticated user info from the token.

    discordClient.getUserInformation().then(user => {
        console.log(user);
    }).catch(err => {
        console.error(err);
    });
    
  • getMessagesInChannel()

    Fetch messages from a specific channel.

    discordClient.getMessagesInChannel('channelId', 10).then(messages => {
        console.log(messages);
    }).catch(err => {
        console.error(err);
    });
    
  • sendMessageToChannel()

    Send a message to a specific channel.

    discordClient.sendMessageToChannel('channelId', 'Hello, Discord!').then(message => {
        console.log('Message sent:', message);
    }).catch(err => {
        console.error(err);
    });
    
  • deleteMessageInChannel()

    Delete a specific message from a channel.

    discordClient.deleteMessageInChannel('channelId', 'messageId').then(response => {
        console.log('Message deleted:', response);
    }).catch(err => {
        console.error(err);
    });
    
  • joinGuildByInvite()

    Join a guild using an invite code.

    discordClient.joinGuildByInvite('inviteCode').then(guild => {
        console.log('Joined guild:', guild);
    }).catch(err => {
        console.error(err);
    });
    
  • leaveGuild()

    Leave a specified guild.

    discordClient.leaveGuild('guildId').then(response => {
        console.log('Left guild:', response);
    }).catch(err => {
        console.error(err);
    });
    
  • muteMemberInVoiceChannel()

    Mute a member in a voice channel.

    discordClient.muteMemberInVoiceChannel('guildId', 'memberId', true).then(response => {
        console.log('Member muted:', response);
    }).catch(err => {
        console.error(err);
    });
    
  • createChannel()

    Create a new channel in a guild.

    discordClient.createChannel('guildId', { name: 'new-channel', type: 0 }).then(channel => {
        console.log('Channel created:', channel);
    }).catch(err => {
        console.error(err);
    });
    
  • updateChannel()

    Update a specific channel's details.

    discordClient.updateChannel('channelId', { name: 'updated-channel' }).then(channel => {
        console.log('Channel updated:', channel);
    }).catch(err => {
        console.error(err);
    });
    
  • deleteChannel()

    Delete a specific channel.

    discordClient.deleteChannel('channelId').then(response => {
        console.log('Channel deleted:', response);
    }).catch(err => {
        console.error(err);
    });
    
  • addReaction()

    Add a reaction to a message.

    discordClient.addReaction('channelId', 'messageId', '😀').then(response => {
        console.log('Reaction added:', response);
    }).catch(err => {
        console.error(err);
    });
    
  • removeReaction()

    Remove a reaction from a message.

    discordClient.removeReaction('channelId', 'messageId', '😀').then(response => {
        console.log('Reaction removed:', response);
    }).catch(err => {
        console.error(err);
    });
    
  • createWebhook()

    Create a webhook in a channel.

    discordClient.createWebhook('channelId', { name: 'new-webhook' }).then(webhook => {
        console.log('Webhook created:', webhook);
    }).catch(err => {
        console.error(err);
    });
    
  • updateWebhook()

    Update a specific webhook.

    discordClient.updateWebhook('webhookId', { name: 'updated-webhook' }).then(webhook => {
        console.log('Webhook updated:', webhook);
    
    
    }).catch(err => {
        console.error(err);
    });
    
  • deleteWebhook()

    Delete a specific webhook.

    discordClient.deleteWebhook('webhookId').then(response => {
        console.log('Webhook deleted:', response);
    }).catch(err => {
        console.error(err);
    });
    
  • listGuildEmojis()

    List all emojis from a guild.

    discordClient.listGuildEmojis('guildId').then(emojis => {
        console.log('Guild emojis:', emojis);
    }).catch(err => {
        console.error(err);
    });
    
  • createGuildEmoji()

    Create a new emoji in a guild.

    discordClient.createGuildEmoji('guildId', { name: 'emojiName', image: 'data:image/png;base64,...' }).then(emoji => {
        console.log('Emoji created:', emoji);
    }).catch(err => {
        console.error(err);
    });
    
  • updateGuildEmoji()

    Update a specific emoji in a guild.

    discordClient.updateGuildEmoji('guildId', 'emojiId', { name: 'newEmojiName' }).then(emoji => {
        console.log('Emoji updated:', emoji);
    }).catch(err => {
        console.error(err);
    });
    
  • deleteGuildEmoji()

    Delete a specific emoji from a guild.

    discordClient.deleteGuildEmoji('guildId', 'emojiId').then(response => {
        console.log('Emoji deleted:', response);
    }).catch(err => {
        console.error(err);
    });
    
  • setBotPresence()

    Set the bot user's presence.

    discordClient.setBotPresence({ status: 'online', game: { name: 'Playing something cool' } }).then(response => {
        console.log('Presence set:', response);
    }).catch(err => {
        console.error(err);
    });
    
  • sendDirectMessage()

    Send a direct message to a user.

    discordClient.sendDirectMessage('userId', { content: 'Hello there!' }).then(message => {
        console.log('Direct message sent:', message);
    }).catch(err => {
        console.error(err);
    });
    
  • getAuditLogs()

    Retrieve audit logs from a guild.

    discordClient.getAuditLogs('guildId').then(logs => {
        console.log('Audit logs:', logs);
    }).catch(err => {
        console.error(err);
    });
    

Contributing

Contributions are welcome! If you're interested in helping out, please read our contributing guidelines.

License

This project is licensed under the ISC License - see the LICENSE file for details.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 1

Native requirements
1 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
04-zkapp-browser-ui
Environment
{
  "local_name": "04-zkapp-browser-ui",
  "alias": false,
  "peer_metadata": null
}
^1.0.2runtime

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-51gSOwdajY29uG9rbMd6L6/XleDI21H3YriXhT1Rh/R1G4w3BgLdghv1EIK+lRdH8Zlf1QFjDRI72pXhAUHtRQ==",
  "shasum": "e1072d6bf9a1df235f2d12e07df10dc91767f485",
  "tarball": "https://registry.npmjs.org/04-zkapp-browser-ui/-/04-zkapp-browser-ui-1.1.4.tgz",
  "fileCount": 46,
  "unpackedSize": 1074475,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEUCIHx4qNTChDuq9rqnuqHJid4HTiFlLTS9gPb/N+vOIICuAiEAyRwhpJHObjR/epPSOMbjT0nVu+lp6jnVXCzx2UD8V18="
    }
  ]
}

Repository

PENDING
ramdani87/04-zkapp-browser-ui

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:13 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:0b3d7485f9e892b45fe705b77d68fa490ce1703d53fc550cd6edd8f1a816c0a0

Other collected versions

1.0.27 Mar1.1.23 Mar1.0.03 MarView all collected versions →