Skip to content

Instantly share code, notes, and snippets.

@Jacbo1
Last active September 27, 2024 08:26
Show Gist options
  • Save Jacbo1/3b3e2702b4b6f210872348b7b42b4cba to your computer and use it in GitHub Desktop.
Save Jacbo1/3b3e2702b4b6f210872348b7b42b4cba to your computer and use it in GitHub Desktop.
NotSoBot Tag Scripting Help

NotSoBot tag scripting help

Note: This information is not maintained or updated. Some old info may no longer be accurate and newer info may not be included.
Majority of guide from cake#0001 in the NotSoBot Discord server. Additions made by me.

How to use NotSoBot tags

Use .t add <tag_name> <tag_contents> to create a new tag or edit an existing one. Tag names are case insensitive meaning a tag by the name of "HeLlO" is the same as "hello".
.t add Hello World will create a tag named "hello".
.t edit <tag_name> <tag_contents> can be used to edit an existing tag the same way as using .t add <tag_name> <tag_contents> You can run a tag by using .t <tag_name>. If it is a script that accepts arguments, your arguments will be words following the tag name separated by spaces. .t hi abc 1 2 will run the tag named "hi" with the 3 arguments "abc", "1", and "2".
.t remove <tag_name> will delete that tag e.g. .t remove hello

Functions

  • {user} - Your username
  • {mention} - Pings you
  • {discrim} - Your discriminator. This is the number after the # in cake#0001
  • {id} - Your ID. This is a unique number that corresponds to your account. It will not change if you change your name.
  • {nick} - Your nickname (username by default)
  • {server} - Server name
  • {servercount} - Number of users on the server
  • {serverid} - The server's ID
  • {channel} - The name of the channel the tag was used
  • {channelid} - The id of the channel the tag was used (try <#{channelid}> for a mention)
  • {args} - All the text that came after the tag name. If tag "test" is {args}, .t test abc 1 2 will produce abc 1 2
  • {arg:number} - A specific-numbered argument, starting at 0 for the first argument. {arg:0} returns the first argument, {arg:1} returns the second, etc.
  • {argslen} - The number of arguments
  • {avatar} - Your avatar URL
  • {randuser} - A random username from the server
  • {randonline} - A random online username on the server
  • {randchannel} - A random channel on the server
  • {choose:A|B|...} - A random item in the list. {choose:A|B|C} will become a random parameeter of either A, B, or C. It accepts any amount of arguments with the minimum being 2.
  • {range:min|max} - A random integer number betweeen the min and max inclusively. {range:1|3} will return either 1, 2, or 3.
  • {replace:find|with|in} - Replaces text. All occurrences of find in in will be replaced with with. Case insensitive
  • {replaceregex:regex|with|in} - Replace text using regex patterns. Case insensitive
  • {upper:text} - UPPERCASE TEXT
  • {lower:text} - lowercase text
  • {url:text} - Converts URL to proper encoding
  • {if:{id}|=|abc|then:potato|else:idk}
    The |else: is optional if you only want to have the |then: case
    Valid Conditions/Comparisons: |=| (Equal) |<| (Less than) |>| (Greater than) |>=| (Greater/equal) |<=| (Less/equal) |~| (Ignore-case equal) |?| (Regex)
  • {set:variable|value} - Set a temporary variable to call later on in the tag. {set:myvar|123} will store 123 to the variable named "myvar"
  • {get:variable} - Retrieves the value of a temporary variable. {get:myvar} will return 123
  • {note:text} - Comment, completely removed during parsing
  • {prefix} - Returns the first current bot prefix. This is what you start NotSoBot commands with. E.g. "."
  • {eval:text} - Parses and runs the text
  • {substring:text|start} - Returns the substring from the starting position to the end. 0 indexed. {substring:abcde|3} becomes de
  • {substring:text|start|end} - Returns the substring from the starting position and stops just before the ending position. 0 indexed. {substring:abcde|3|4} becomes d
  • {nsfw} - Mark a tag as NSFW
  • {ignore:{eval:text}} - Reevaluates text (useful with {ignore})
  • {ignore:text} - Ignores script tags in text
  • {length:text} - Number of characters in text
  • {attach/file:url|filename (optional)} - Attaches an image (Ex: {attach:example.org/image.png})
  • {text:url } - Returns the text contents of the URL. You can put a space between the url and "}" to prevent discord from including text after the url in the url.
  • {lattach} - Returns URL of the last attachment in chat
  • {code:text} - Puts text into a code block
like this
  • {<language>:<code>} - Runs code in the specified language. E.g. {lua:print("Hello, world!")} will run print("Hello, world!") in lua

Useful information

You can create tags scripts of unlimited length by uploading a txt file to Discord and getting the url or using Pastebin and clicking the button that says "raw" after creating, and using the url of that page. If you use Pastebin, your script will automatically update if you change it.
In this example, the text from https://pastebin.com/raw/7TbjduC7 is Hello, {nick}! 😃.
If we make a tag using .t add greeting {eval:{text:https://pastebin.com/raw/7TbjduC7 }} and then run it with .t greeting, NotSoBot will say "Hello, Jacbo1! 😃"
Keep in mind that tags like this will run slower because NotSoBot has to retrieve the data from online.

@Jacbo1
Copy link
Author

Jacbo1 commented Dec 26, 2023

Pretty sure I got everything that was on the old wiki (or wherever I got this info from, it's been so long I don't remember where) when I made this and I haven't been updating it. Never heard of iscript

@ElPeppyWall
Copy link

Pretty sure I got everything that was on the old wiki (or wherever I got this info from, it's been so long I don't remember where) when I made this and I haven't been updating it. Never heard of iscript

Yeah i was curious because i had gotten very into notsobot tag scripting recently and i saw some commands, documentation and that stuff in an old server that used iscript to generate images. It's understandable you don't know anything about it though, i think it was pretty obscure and almost nobody used it judging by the imagescript documentation site being outdated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment