GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - MZshnik/MZscript: Improved BDFD interpreter in Python

BranchesTags
Open more actions menu

Latest commit

 

History

166 Commits
166 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
src/MZscript
src/MZscript
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

MZscript

Improved BDFD interpreter in Python

PyPi

Documentation

Docs site

Repository

Discord

for contact with @MZshnik (mzshnik/MZecker)

Contribution

Works on (tested) Python 3.10 and newer

Instaling💻

pip install MZscript

Updating📥

pip install --upgrade MZscript

First steps🎉

Create your first command:

from MZscript import MZClient

bot = MZClient()

bot.add_command(name="!help", code="""
$sendMessage[
Whats up?
!moderation
!info
!economy]
""")

bot.run("your bot token")

Try $if blocks:

bot.add_command(name="!help", code="""
$sendMessage[
Choose menu:
$if[$message[0]==mod]
You choose moderation
$elif[$message[0]==mod]
You choose info
$elif[$message[0]==mod]
You choose economy
$else
!help moderation
!help info
!help economy
$endif]
""")

Change prefix with variables:

# insert code in to on_ready is necessary
bot = MZClient(on_ready="""
$if[$getVar[prefix]==]
$setVar[prefix;!]
$endif
$console[Bot is ready]
""")

bot.add_command(name="$getVar[prefix]set-prefix", code="""
$if[$message[0]==]
$setVar[prefix;$message[0]]
$sendMessage[Prefix setted to "$message[0]"]
$updateCommands[] <-- update command names
$else
$sendMessage[Type some prefix, like: !, ?, #...]
$endif
""")

bot.add_command(name="$getVar[prefix]get-prefix", code="""
$if[$getVar[prefix]==]
$setVar[prefix;!] <-- default prefix
$endif
$sendMessage[Prefix is "$getVar[prefix]"]
""")

bot.add_command(name="$getVar[prefix]help", code="""
$sendMessage[
$getVar[prefix]help moderation
$getVar[prefix]help info
$getVar[prefix]help economy
]""")

Create buttons with events

bot.add_command(name="!button", code="""
$sendMessage[
Content;Title;Description;footer;;0058CF;;;;; <-- embed args
;#addButton[primary;Amogus;False;amogus] <-- embed tags
;#addField[Amogus;Click me] <-- another tag
]""")

bot.add_event(name="button", code="""
$defer <-- defer button response
$if[$customID==amogus]
$sendMessage[New amogus in $channelInfo[name]]
$else
$console[Button "$customID" dosnot set]
$endif
""")

Make lvl system:

bot.add_command(name="!lvl", code="""
$if[$getUserVar[lvl]==]
$setUserVar[lvl;1]
$endif
$sendMessage[Your lvl: $getUserVar[lvl]($getUserVar[exp]/100 xp to lvl up)]""")

bot.add_event(name="message", code="""
$if[$getUserVar[lvl]==]
$setUserVar[lvl;1]
$endif
$if[$getUserVar[exp]==]
$setUserVar[exp;0]
$endif
$setUserVar[exp;$calculate[$getUserVar[exp]+2]]
$if[$calculate[$getUserVar[exp]/100]==1]
$setUserVar[lvl;$calculate[$getUserVar[lvl]+1]]
$endif
""")

Content

List of all functions
Function Full support No args Can be no/with args
$if + - -
$or + - -
$and + - -
$elif + - -
$else + + -
$endif + + -
$stop + + -
$eval - - -
$pyeval - - -
$botInfo - - -
$channelInfo + - -
$guildInfo + - -
$messageInfo + - -
$roleInfo + - -
$userInfo + - -
$hasPerms - - -
$hasRole + - -
$isAdmin + - -
$isChannelExists + - -
$isGuildExists + - -
$isMemberExists + - -
$isNumber + - -
$isRoleExists + - -
$isUserExists + - -
$sendMessage + - -
$editMessage + - -
$message + - -
$addReaction + - -
$addRole + - -
$removeRole + - -
$ban + - -
$clear + - -
$kick + - -
$unban + - -
$text + - -
$charCount + - -
$lowerCase + - -
$replaceText + - -
$titleCase + - -
$upperCase + - -
$customID + + -
$value + - -
$options - - -
$defer + + -
$var + - -
$getVar + - -
$setVar + - -
$delVar + - -
$getMemberVar + - -
$setMemberVar + - -
$delMemberVar + - -
$gelGuildVar + - -
$setGuildVar + - -
$delGuildVar + - -
$getUserVar + - -
$setUserVar + - -
$delUserVar + - -
$request + - -
$botTyping + - -
$random + - -
$calculate + - -
$getTimestamp + + -
$wait + - -
$loop + - -
$for + - -
$updateCommands + - +
$uptime + - +
$docs + - -
$console + - -

Full support means is function 100% works/tested

List of functions tags:

Function Tags
$sendMessage #addButton, #addMenu, #addOption, #addField, #addReaction

List of events:

Name Description
on_ready Activated when bot ready to work
message Activated when anyone send message
button Activated when anyone press button from bot
interaction Activated when anyone use interaction from bot (button/menu/slash)
check Checker for command execution(beta)
invoked Invoked when command executed(beta)

In Developing🔨

  • More functions from BDFD
  • More custom functions
  • Documentation
  • Сontributing
  • Plugins (mods)

In the Future🚀

  • More usefull $eval/$pyeval
  • Compiled version or support for other langs

MZscript not developering

Closed for better time. If anyone interested to contribute or has ideas - join Discord server and/or DM mzshnik

Repository and first lines of code by MZshnik

About

Improved BDFD interpreter in Python

mzscript.vercel.app/

Topics

bdfd-clonediscord-botdisnakeeasy-to-useinterpretatoropen-sourcepython

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

12 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.