Giter VIP home page Giter VIP logo

discordia-slash's Introduction

Spar


Languages, technologies, stuff, frameworks and tools I've used in some way:
  • C++, Lua, LuaJIT, C++17, C++20, Python, Plain HTML + CSS + JavaScript, Groovy
  • Boost, telecom (LTE), 3GPP, PostgreSQL, Docker, MySQL, fmt, SQLite, protobuf, webhook, coroutines, async, regex
  • CalDAV, Diameter protocol, WebSocket, SOAP API, JSON, REST API, SVG, XML
  • Compiler development, web scraping (University sites, Cian.ru, various property developer sites, Notion, hh.ru), C++ reverse-engineering/decompilation (x86-64, ARMv7-M) using IDA and Ghidra, DSL, Bot development (Discord, Telegram, VK, Pachca), logging, game server frontend/backend development, optimizations, gamedev, analytics, game UI development
  • Source Engine, Luvit, Raspberry Pi, Nelua, Linux, LÖVE, NodeMCU, Arduino
  • CMake, Conan, Grafana, Prometheus

My Projects:

  • Hanley bot — Successfull pet-project bot written in C++ with over 200 users made for psychology specialists.
  • Lua Patterns — A tool to learn and analyze Lua Patterns.
  • Lua Infographics — Collection of infographics dedicated to Lua (Some serious and just for fun).
  • LuaJIT Benchmarks — A page about optimizing Lua by benchmarking several variants of the same code and finding the best one (among them).
  • LLLua — My language I plan to develop. See the concept for the future version (0.1 version can be already used).
  • luamemprof — Memory profiler module for Lua and LuaJIT.
  • My Discordia Libraries — The open-sourced part of Toolgun bot developed for the Garry's Mod official Discord server. The server has over 80,000 members as yet replacing the need for additional human moderation for more than 3 years. Includes Lua minidump reader library.
  • discordia-slash — Discordia's extension for slash commands.
  • Love2D Framework — Framework with GUI, timers and texture loading libraries based on GMod API.
  • GodSentTools — Series of GMod addons, mainly for art and moviemakers.
  • RemPos — GMod C++ module that connects iOS app with GMod and brings acceleration and gyroscope data.
  • My GMod Libraries — Public libraries I made for my GMod server. Server is dead, but libraries can be used/refactored.
  • University admission advisor — Bot written in Lua with VK API that downloads lists of applicants from different universities with my specialization, parses them and calculates the chance to pass.
  • UniBot — Bot written in Lua with VK API that gives information about the schedule, next lesson and other things.
  • LuaCUE — Corsair Utility Engine module for Lua written in C++.
  • SparTask — Windows taskbar replacement for focusing on specific task, allows putting only necessary icons.

See all repositories...

Important

Since 2017 I've contributed a lot to Garry's Mod. Check out this list as well.

Projects I participated in:

Small projects:

GitHub Stats:

Top Langs

  • 17 PRs for open source projects. Most noticeable contributions is the Garry's Mod codebase.
  • 29 bug reports and suggestions only for Garry's Mod and same amount for other open source projects.
  • HitCount

discordia-slash's People

Contributors

bilal2453 avatar gitspartv avatar inzan17 avatar matkijahenkilo avatar ta-noshii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

discordia-slash's Issues

Missing Not

A believe there is a missing not in discordia-slash -> util -> tools.lua line 236.

Command with no parameters errors

local params = makeParams(data.options, ia.guild)

data.options is optional according to the interaction data structure spec
https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure

Uncaught Error: ...uff/ACCOUNT TRACKER/deps/discordia-slash/Application.lua:26: bad argument #1 to 'ipairs' (table expected, got nil)
stack traceback:
        [C]: in function 'ipairs'
        ...uff/ACCOUNT TRACKER/deps/discordia-slash/Application.lua:26: in function 'makeParams'
        ...uff/ACCOUNT TRACKER/deps/discordia-slash/Application.lua:48: in function <...uff/ACCOUNT TRACKER/deps/discordia-slash/Application.lua:42>

v.type in makeParams returns nil

For some users, the v.type (subCommand) returns nil.
Uncaught Error: /home/santa/deps/discordia-slash/Application.lua:33: attempt to call a nil value

attempt to index local 'args' (a nil value) error when the only optional argument is not provided

whenever a slash command option is optional and not provided, it returns this error:

attempt to index local 'args' (a nil value)

this is my code:

local slashCommand = {}
local option = {}

slashCommand = tools.slashCommand("amount", "see amount of flops you/user have/has said")
option = tools.user("member", "the member")

option = option:setRequired(false)

slashCommand = slashCommand:addOption(option)

client:createGlobalApplicationCommand(slashCommand)
client:on("slashCommand", function(interaction, command, args)
    if command.name == "amount" then
        if db[ tostring( args.member.id ) ] then
            interaction:reply( args.member.name .. " has said flop " .. tostring( db[ tostring( args.member.id ) ] ) .. " times" )
        else
            interaction:reply( args.member.name .. " hasn't said flop" )
        end
    end
end)

any help?

Invalid interation application command

local dis = require("discordia")
local slash = require("discordia-slash")
slash.constructor()
local client = dis.Client()
client:useSlashCommands()

client:on("slashCommandsReady", function()
	client:slashCommand({
		name = "test2",
		description = "description",
		options = {
			{
				name = "arg",
				description = "argdesc",
				type = slash.enums.optionType.string,
				required = true
			}
		},
		callback = function(ia, params, cmd)

		end
	})
end)

Ran this code (Basically straight from the readme docs) and got this error
Screenshot 2022-01-17 184351

Console
Screenshot 2022-01-17 184345

I'm new to Discordia and this addon so sorry If I'm being dumb

Invalid interaction application command

So, when I tried to reply to interaction, this showed up :
invalidInter

This is my code :

client:on("slashCommandsReady", function()
for _,i in pairs(fs.readdirSync("./commands")) do
  local fileName = string.sub(i, 1, #i - 4)
      local commandModule = require("./commands/" .. i)
          print("Loading " .. fileName)
          local commandSlash = client:slashCommand({
            name = fileName,
            description = commandModule.desc,
            options = commandModule.options,
            callback = function(ia, params, cmd)
            ia:reply("yes")
              --commandModule.execute(client, ia, params)
            end
          })
          print("Loaded " .. fileName)
          local succes, error = pcall(function()
              commandSlash:publish()
          end)
          if not succes then
          print("Failed to publish " .. fileName)
          print(error)
          else
          print("Published " .. fileName)
          end
end
end)

Didn't work for me

Can a video tutorial be made about this? I'm super confused about how I should be doing this. I tried to use:
client:slashCommand()
using the example. It doesn't show up as an error anymore, but I'm not sure what's supposed to happen after. The slash command doesn't appear in Discord, and when I tried to test the example ban command, it came up with an error (yes, I changed "guildid" to the actual guild id). It just errors with "bad request," and I'm stumped on how to fix this. Slash commands for my bot aren't THAT important to me, but I'd like to have them.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.