Skip to content

About

This is the current version of DiscordAMX, making use of the PAWN embedded scripting language, which allows the scripting of "simpler" but also more complex discord bot actions and functions.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

discordamx

Please read the Wiki page for all information. This requires some knowledge about the PAWN language.

❗ 📣 Looking for testers (I provide virtual windows server hosting if needed, for free!)

Contact if you want to test discordamx within your project(s) and if there is need for running 24/7 I can provide a user account withing my virtual server I got "laying around".

Contact me on discord: toketwo#4598

❗ Our official discord-server https://discord.gg/pVqxSz3fMb


Voice audio

Voice playback requires FFmpeg. Place ffmpeg.exe next to discordamx.exe or install FFmpeg and add it to PATH. FFmpeg decodes audio to Discord's required PCM format; MP3 and direct HTTP(S) audio streams are supported, and video files such as MP4 are played audio-only. The bot needs permission to connect and speak in the target voice channel.

Guild IDs in these natives are DiscordAMX's script guild IDs (the IDs used by the other guild natives). Channel IDs are Discord snowflake IDs passed as strings. Local file paths are relative to the application folder; subfolders are supported, and paths outside that folder are rejected.

DC_IsVoiceConnected(guildid);       // 1 = verbunden, 0 = nicht verbunden
DC_IsVoiceAudioPlaying(guildid);    // 1 = Audioquelle aktiv, auch pausiert; 0 = keine Wiedergabe
DC_JoinVoiceChannel(guildid, channelid[]);
DC_PlayAudioFromURL(guildid, url[]);
DC_PlayAudioFile(guildid, file[]);
DC_VoicAudioPlayback(guildid, action); // 0 = resume, 1 = pause
DC_StopVoiceAudio(guildid);
DC_LeaveVoiceChannel(guildid);

A new playback replaces the current playback in that guild. Voice connections and playback are managed independently per guild, so the bot can play in multiple guilds at once.

Script shutdown callback

Loaded scripts may implement OnSystemExit(exitCode). DiscordAMX passes the integer exit code it will use to terminate the process, then calls the script's existing OnUnload(). The exit code is application-defined; Windows and Linux do not provide a universal list of exit codes or a process exit code describing why a console was closed. For Ctrl+C and console-close signals, the current shutdown path uses the default code 0, unless the application calls StopEverything(code) with another value. This callback is best-effort and cannot run after forced process termination or power loss.

Todo

  • Test internal user join and leave logic (keeping track of users to make scripting with user ids and guild ids)
  • Forum Support
  • Music (MP3, YOUTBE) support for voice chat
  • Rewrite command systems, use the command system that DSharp+ is actually having.
    • Example would be RegisterCommand(context_callback[], role??, help_text??) , called to register command.
    • The callback would then be called when the internal DS+ command execution happends, passing above stuff to script?

Better readme soon.

alt_text

About

This is the current version of DiscordAMX, making use of the PAWN embedded scripting language, which allows the scripting of "simpler" but also more complex discord bot actions and functions.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages