[F/OS] DiscordInventor - an extension for creating bots for Discord servers

Discord-Inventor

This extension enables you to build bots that can interact with Discord servers, send and monitor messages, and handle real-time events.

Features

  • Real-time monitoring of Discord channels using WebSockets.
  • Send, edit, and delete messages in Discord channels.
  • Cooldown functionality to prevent rate-limiting.
  • Custom event handling for new messages and errors.

DiscordEvents

Discord Channel Monitor Extension - Monitors Discord channels in real-time using WebSocket without exceeding API limits.

Events:

OnDiscordEvent

OnDiscordEventBlock

Triggered when a Discord event occurs. Returns tag and event information.

Parameter Type
tag text
eventInfoList list

OnResponse

OnResponseBlock

Triggered when a response is received.

Parameter Type
tag text
response text

OnError

OnErrorBlock

Triggered when an error occurs.

Parameter Type
tag text
error text

Methods:

StartMonitoring

StartMonitoringBlock

Starts monitoring Discord channels in real-time.

Parameter Type
tag text

StopMonitoring

StopMonitoringBlock

Stops monitoring Discord channels.

Parameter Type
tag text

Properties:

SetBotToken

SetBotTokenBlock

Sets the Discord Bot Token for authentication.

DiscordModeration

Discord Moderation Extension - Provides tools for server moderation, including checking user permissions, roles, and more.

Events:

OnResponse

OnResponseBlock (1)

Triggered when a successful response is received.

Parameter Type
tag text
response text

OnError

OnErrorBlock (1)

Triggered when an error occurs.

Parameter Type
tag text
error text

Methods:

CheckUserPermission

CheckUserPermissionBlock

Checks if a user has a specific permission in a guild.

Parameter Type
guildId text
userId text
permission text
tag text

CheckAdminOrOwner

CheckAdminOrOwnerBlock

Checks if a user is an administrator or the owner of the bot.

Parameter Type
guildId text
userId text
tag text

KickUser

KickUserBlock

Kicks a user from the specified guild.

Parameter Type
guildId text
userId text
reason text
tag text

BanUser

BanUserBlock

Bans a user from the specified guild.

Parameter Type
guildId text
userId text
reason text
deleteMessageDays number
tag text

UnbanUser

UnbanUserBlock

Unbans a user from the specified guild.

Parameter Type
guildId text
userId text
tag text

Properties:

SetBotToken

SetBotTokenBlock (1)

Sets the Discord Bot Token for authentication.

DiscordText

Discord Bot Message Extension - Allows sending, editing, deleting, and monitoring messages on Discord.

Events:

OnResponse

OnResponseBlock (2)

Triggered when a successful response is received.

Parameter Type
tag text
response text

OnError

OnErrorBlock (2)

Triggered when an error occurs.

Parameter Type
tag text
error text

OnCooldown

OnCooldownBlock

Triggered when a command is on cooldown. Returns the remaining cooldown time.

Parameter Type
tag text
command text
secondsRemaining number

Methods:

SendMessage

SendMessageBlock

Sends a message to the specified Discord channel in the given server.

Parameter Type
guildId text
channelId text
content text
tag text
cooldownSeconds number

EditMessage

EditMessageBlock

Edits an existing message in the specified channel within the given server.

Parameter Type
guildId text
channelId text
messageId text
newContent text
tag text
cooldownSeconds number

DeleteMessage

DeleteMessageBlock

Deletes a message from the specified channel in the given server.

Parameter Type
guildId text
channelId text
messageId text
tag text
cooldownSeconds number

PinMessage

PinMessageBlock

Pins a message in the specified Discord channel.

Parameter Type
guildId text
channelId text
messageId text
tag text
cooldownSeconds number

UnpinMessage

UnpinMessageBlock

Unpins a message in the specified Discord channel.

Parameter Type
guildId text
channelId text
messageId text
tag text
cooldownSeconds number

GetMessages

GetMessagesBlock

Fetches messages from a specified Discord channel.

Parameter Type
guildId text
channelId text
limit number
tag text
cooldownSeconds number

CreateThread

CreateThreadBlock

Creates a thread in a Discord channel with a specified message.

Parameter Type
guildId text
channelId text
messageId text
threadName text
autoArchiveDuration number
tag text
cooldownSeconds number

UpdateThread

UpdateThreadBlock

Updates the name or auto-archive duration of a thread in a Discord channel.

Parameter Type
guildId text
threadId text
newName text
autoArchiveDuration number
tag text
cooldownSeconds number

DeleteThread

DeleteThreadBlock

Deletes a thread from a Discord channel.

Parameter Type
guildId text
threadId text
tag text
cooldownSeconds number

AddUserToThread

AddUserToThreadBlock

Adds a user to a thread in a Discord channel.

Parameter Type
guildId text
threadId text
userId text
tag text
cooldownSeconds number

RemoveUserFromThread

RemoveUserFromThreadBlock

Removes a user from a thread in a Discord channel.

Parameter Type
guildId text
threadId text
userId text
tag text
cooldownSeconds number

ListActiveThreads

ListActiveThreadsBlock

Gets a list of all active threads in a specified Discord channel.

Parameter Type
guildId text
channelId text
tag text
cooldownSeconds number

Properties:

SetBotToken

SetBotTokenBlock (2)

Sets the Discord Bot Token for authentication.

Files

AIX (ProGuarded)

AIA

Docs

Click here and buy me a coffee.

4 Likes

A nice extension :ok_hand:

Renaming some blocks as shown below would be good practice.

OnDiscordEvent to DiscordEvent
OnResponse to Response
OnError to Error
OnCooldown to Cooldown
SetBotToken to BotToken

2 Likes

Good tip. I think that's my usual practice with bots written with Discord.py.


image

New commands

2 Likes

Sy sudah mengikuti block program yang ada namun terjadi eror apa yang harus saya lakukan ?

Could you please describe the error you are encountering?

Terjadi pesan eror yang tidak saya pa

Uploading: Screenshot_2024_1227_141436.jpg…



Screenshot_2024_1227_153636

Uploading: Screenshot_2024_1227_141436.jpg…
Uploading: Screenshot_2024_1227_153614.png…


Did you use your own botToken from the Discord portal? Another thing, you should enable message intents and others if needed. See https://youtube.com/shorts/RTgkgzJPd_E?si=kklXWcgOwfv-oiv5

masih terjadi eror di bagian server id dan chanel id

Have you already added the bot to your server and followed the steps in https://youtube.com/shorts/RTgkgzJPd_E?si=kklXWcgOwfv-oiv5 ?


masih terjadi erro seperti ini

Even enabling all intents in developer panel?