Sopur's user bot library
Hello! This is a user bot library the allows
for a lot more things than Discord.js.
For example, this library allows you to access
to everything a legit client does:
like user notes, friend counts,
the defualt Discord tutorial,
and everything else.
This library is in a early state
and needs more work.
More functions will be added soon.
Installing
npm i discord-user-bots
Getting started
Here's a small example of this library:
const Discord = require("discord-user-bots");
const client = new Discord.Client("Token goes here.");
client.on.ready = function () {
console.log("Client online!");
};
client.on.message_create = function (message) {
console.log(message);
};
Functions
client.fetch_messages(
100,
"794326789480120374",
"914533507890565221"
);
client.get_guild(
"794326789480120374"
);
client.join_guild(
"https://discord.gg/WADasB31"
);
client.get_invite_info(
"https://discord.gg/WADasB31"
);
client.leave_guild(
"794326789480120374"
);
client.delete_guild(
"794326789480120374"
);
client.send(
"794326789480120374",
{
content: "Hello Discord-user-bots!",
reply: "914533507890565221",
tts: false,
embeds: [],
allowed_mentions: {
allowUsers: true,
allowRoles: true,
allowEveryone: true,
allowRepliedUser: true,
},
components: [],
stickers: [],
}
);
client.edit(
"794339629553156116",
"794329000897806387",
"Edited!"
);
client.delete_message(
"794339629553156116",
"794329000897806387"
);
client.type(
"794326789480120374"
);
client.stop_type();
client.group(
["person-id", "you can have up to 10", "(Including you)"]
);
client.leave_group(
"785986028955500596"
);
client.remove_person_from_group(
"person-id",
"785986028955500596"
);
client.rename_group(
"Discord-user-bot's group",
"785986028955500596"
);
client.create_server(
"Discord-user-bot's server",
"2TffvPucqHkN"
);
client.create_thread_from_message(
"811442648677875722",
"753267478943105024",
"Discord-user-bot's thread from a message",
1440
);
client.create_thread(
"888825512510779414",
"Discord-user-bot's thread from a channel",
1440
);
client.delete_thread(
"888825512510779414"
);
client.add_reaction(
"914533528245506068",
"753267478943105028",
"🤖"
);
client.change_status(
"online"
);
client.set_custom_status({
text: "This status was set by Discord-user-bots!",
emoji: "🤖",
expireAt: "2021-12-13T05:57:58.828Z",
});
client.parse_invite_link(
"https://discord.gg/WADasB31"
);
client.set_config(
"v9",
"wss://gateway.discord.gg/?encoding=json&v=9",
"linux",
"holy",
"en-US",
1000
);
Event listeners
client.on = {
discord_disconnect: function () {},
gateway: function () {},
heartbeat_sent: function () {},
heartbeat_received: function () {},
ready: function () {},
voice_server_update: function (message) {},
user_update: function (message) {},
application_command_create: function (message) {},
application_command_update: function (message) {},
application_command_delete: function (message) {},
interaction_create: function (message) {},
guild_create: function (message) {},
guild_delete: function (message) {},
guild_role_create: function (message) {},
guild_role_update: function (message) {},
guild_role_delete: function (message) {},
thread_create: function (message) {},
thread_update: function (message) {},
thread_delete: function (message) {},
thread_list_sync: function (message) {},
thread_member_update: function (message) {},
thread_members_update: function (message) {},
channel_create: function (message) {},
channel_update: function (message) {},
channel_delete: function (message) {},
channel_pins_update: function (message) {},
guild_member_add: function (message) {},
guild_member_update: function (message) {},
guild_member_remove: function (message) {},
guild_ban_add: function (message) {},
guild_ban_remove: function (message) {},
guild_emojis_update: function (message) {},
guild_stickers_update: function (message) {},
guild_integrations_update: function (message) {},
guild_webhooks_update: function (message) {},
invite_create: function (message) {},
invite_delete: function (message) {},
voice_state_update: function (message) {},
presence_update: function (message) {},
message_create: function (message) {},
message_update: function (message) {},
message_delete: function (message) {},
message_delete_bulk: function (message) {},
message_reaction_add: function (message) {},
message_reaction_remove: function (message) {},
message_reaction_remove_all: function (message) {},
message_reaction_remove_emoji: function (message) {},
typing_start: function (message) {},
embed_sent: function (message) {},
message_edit: function (message) {},
};
Properties
My library focuses on allowing you to access
absolutely everthing a normal Discord client can.
This means tons and tons of properties defining your client.
Here are some of them:
this.user_settings = user.user_settings;
this.user = user.user;
this.tutorial = user.tutorial;
this.session_id = user.session_id;
this.notes = user.notes;
this.guild_join_requests = user.guild_join_requests;
this.user_guild_settings = user.user_guild_settings;
this.relationships = user.relationships;
this.read_state = user.read_state;
this.private_channels = user.private_channels;
this.presences = user.presences;
this.guilds = user.guilds;
this.guild_experiments = user.guild_experiments;
this.geo_ordered_rtc_regions = user.geo_ordered_rtc_regions;
this.friend_suggestion_count = user.friend_suggestion_count;
this.experiments = user.experiments;
this.country_code = user.country_code;
this.consents = user.consents;
this.connected_accounts = user.connected_accounts;
this.analytics_token = user.analytics_token;
this._trace = user._trace;
Now here are those properties in a more readable form:
this.user_settings = {
timezone_offset: timezone - offset - goes - here,
theme: "dark",
stream_notifications_enabled: true,
status: "invisible",
show_current_game: true,
restricted_guilds: [],
render_reactions: true,
render_embeds: true,
native_phone_integration_enabled: true,
message_display_compact: false,
locale: "locale-goes-here",
inline_embed_media: true,
inline_attachment_media: true,
guild_positions: [Array],
guild_folders: [Array],
gif_auto_play: true,
friend_source_flags: [Object],
explicit_content_filter: 2,
enable_tts_command: true,
disable_games_tab: false,
developer_mode: true,
detect_platform_accounts: true,
default_guilds_restricted: false,
custom_status: null,
convert_emoticons: true,
contact_sync_enabled: false,
animate_stickers: 0,
animate_emoji: true,
allow_accessibility_detection: false,
afk_timeout: 600,
};
this.user_guild_settings = [[Object]];
this.user = {
verified: true,
username: "Sopur",
premium: false,
phone: null,
nsfw_allowed: true,
mobile: true,
mfa_enabled: false,
id: "id-goes-here",
flags: 0,
email: "email-goes-here",
discriminator: "discriminator-goes-here",
desktop: true,
avatar: "avatar-goes-here",
};
this.tutorial = null;
this.session_id = "session_id-goes-here";
this.relationships = [[Object]];
this.read_state = [[Object]];
this.private_channels = [[Object]];
this.presences = [[Object]];
this.notes = {
"id-goes-here": "note-goes-here",
};
this.guilds = [[Object]];
this.guild_join_requests = [];
this.guild_experiments = [[Array]];
this.geo_ordered_rtc_regions = ["geo", "ordered", "rtc", "regions", "go", "here"];
this.friend_suggestion_count = 0;
this.experiments = [[Array]];
this.country_code = "country-goes-here";
this.consents = { personalization: [Object] };
this.connected_accounts = [[Object]];
this.analytics_token = "token-goes-here";
this._trace = ["stringified-json"];
What's new
- Made the library throw errors instead of returning them
- Added whole new object to the exports, constructs
- Massive code refactoring
- Fixed documentation mistakes
- Added parse_invite_link to the client to get the invite code from a url
- Changed all function names to snake case
- Added add_reaction, change_status, and set_custom_status
- Added a lot more functionality to the send function
- Added a lot more functionality to the edit function
- Changed create_group to group and changed its description
- Fixed bug where if discord rejected your connection attempt it throws an error
- Changed, fixed, and added more documentation
- Updated packages node-fetch and node-ws
WARN
WHATEVER HAPPENS TO YOUR ACCOUNT AS A RESULT OF THIS LIBRARY IS WITHIN YOUR OWN LIABILITY. THIS LIBRARY IS MADE PURELY FOR TESTS AND FUN. USE AT YOUR OWN RISK.