Questions tagged [luvit]

In Lua, Luvit is an asynchronous I/O library.

24 questions
3
votes
1 answer

How can I use require in Lua to access Luvit's built-in modules?

I am running a Luvit environment on a Ubuntu 16.04 Server VPS used to host my project. This is an image of my current file tree I am currently inside (via the cd command) the WrapperTest folder, and running the main.lua file. This requires the…
Cryogenic
  • 81
  • 7
3
votes
1 answer

Streaming stdout to a web page

This seems like it should be a really simple thing to achieve, unfortunately web development was never my strong point. I have a bunch of scripts, and I would like to launch them from a webpage and see the realtime stdout text on the page. Some of…
Sam
  • 3,659
  • 3
  • 36
  • 49
2
votes
0 answers

Installing Luvit on an openshift server

I can't seem to use luvit at all on the server. It is installed on the machine I am connecting from. I attempted to install luvit via the commands, but it said permissions denied. The info on Openshift's blogpost is out of date, heavily. 2013-level…
DannehSC
  • 21
  • 1
2
votes
1 answer

How do I make require() take a direct path to a file

so I have the following code, and the problem is that when I loop through each file in my array and try to require the file path, it gives me an error of the module isn't found. local Commands = {} function getCommands() local readdir =…
Kremla
  • 87
  • 6
1
vote
1 answer

How do I perform a simple GET request with Luvit HTTPS

I've been trying now for a couple of hours to make a GET request to a simple page and then get the body as a result, but Luvit makes this incredibly complicated. function httpGET() request = networking.get("https://google.com") local…
Reactified
  • 11
  • 1
1
vote
1 answer

How to do a POST request using Luvit

I'm using Luvit for one of my projects which uses some online APIs to make the things simpler. One such API asks me to do a POST request to their endpoint to deal with the data. I looked at their official documentation, and even some unofficial…
Seniru Pasan
  • 753
  • 1
  • 7
  • 13
0
votes
1 answer

Why am i still unauthorized? HTTP Twitch 2AuthO request in Lua with coro-http

I am 100% sure that my client-id and client-secret are valid. I used it in my python code and it just worked fine local http = require("coro-http") local json = require("json") local url = "https://id.twitch.tv/oauth2/token" local client_id =…
kydie
  • 1
0
votes
1 answer

Attempt to call upvalue 'Message' (a table value)

So, I'm working on Discord API wrapper written in Lua, but there's an issue, I use rxi's classic module for creating classes and objects, every class works fine, instead of the one class, Message, while trying to create a message in Interaction…
0
votes
1 answer

Why isn't "bulkDelete()" working in my bot command?

I'm trying to code a Discord bot in lua at the moment and I've having some difficulties. I'm trying to create a bulk delete command for my bot, but it seems to not work and only returns "400 - Bad Request" upon typing the command. Am I doing…
Hazurii
  • 3
  • 1
0
votes
1 answer

Lua returning output after subprocess

Working in lua, I have a table of key/value pairs local fmtsToRun = { name = function() return configSubTable end } Which could be 1 or more entries in length. I need to loop through each entry and run a subprocess (through some libuv C…
mhartington
  • 6,905
  • 4
  • 40
  • 75
0
votes
2 answers

Discordia bot DM sending breaks my script

I am trying to make a bot for my server on discord using Discordia, but when I try to use member:send(str), all I get is Uncaught Error: C:/luvit/deps/coro-channel.lua:62: C:/luvit/deps/discordia/libs/containers/User.lua:91: attempt to call method…
VG3O_J
  • 1
  • 1
0
votes
1 answer

LUVIT DISCORDIA how to get the id of a guild

I want to get the id of the guild when someone types +guildid, so that i can use it for stuff later on.
exdii
  • 7
  • 4
0
votes
1 answer

How to check for user perms (DISCORDIA)

The title speaks for itself, please help, pretty please.
exdii
  • 7
  • 4
0
votes
1 answer

How to read a json of a url with luvit

How I can read the JSON with luvit? I tried using http = require 'http' json = http.parseUrl('https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCQmWt938Z8TkdPq6uasdlbA&type=video&eventType=live&key=[API_KEY]') print(json) The…
Clover
  • 13
  • 3
0
votes
1 answer

Trying to build a Discord bot with Discordia and Lua hasRole() crashes it

So I got my bot working with hasRole() but I added a music playing functionality to it and now every time I call hasRole() it returns nil and crashes the bot. It uses it in the kick, ban, and unban commands. I have no clue what is happening. Anyways…
1
2