teknologi-umum / bot Goto Github PK
View Code? Open in Web Editor NEWBot for a more interactive Teknologi Umum group
Home Page: https://t.me/teknologi_umum
License: GNU General Public License v3.0
Bot for a more interactive Teknologi Umum group
Home Page: https://t.me/teknologi_umum
License: GNU General Public License v3.0
Only use eval if it did not throw any error
/qr https://www.google.com/
See #5
Code:
BigInt(0)
Output:
TypeError: Do not know how to serialize a BigInt
Expected Output:
0
An error was thrown when trying to delete a message on a private chat after calling the /snap
command.
Stack trace:
400: Bad Request: message can't be deleted for everyone
Crashed in non-app: /app/node_modules/telegraf/lib/core/network/client.js in Telegram.callApi
runMicrotasks
Called from: node:internal/process/task_queues in processTicksAndRejections
/app/src/services/snap/snap.js in async snap at line 37:7
Called from: /app/node_modules/telegraf/lib/composer.js in async execute
Error context:
key | value |
---|---|
chat_type | private |
text | /snap |
Fetch https://jokesbapak2.herokuapp.com/v1/
then post the image
/laodeai
the title is self explanatory.
Sentry share URL: https://sentry.io/share/issue/c7e05989fcd1434abde8d9d6dea87058/ (see that link for the full stack trace of where the error came from)
Breadcrumbs:
http GET https://html.duckduckgo.com/html/?kp=1&q=apa+itu+lanlord [200] Info 09:44:09
http GET https://stackoverflow.com/questions/69413743/apa-itu-nonleaguezone-awa [301] Info 09:44:09
http GET https://stackoverflow.com/questions/69413743 [404] Info 09:44:09
exception TypeError: Cannot read property 'type' of undefined Error 09:44:09
Message text: /laodeai apa itu lanlord
The message was sent from a supergroup.
Pingin bikin link ya isinya kumpulan renungan untuk kamerad TU sekalian.
Gimana menurut maintainer sekalian?
Some people are spamming /joke
Please let us know by commenting on this issue if you want to take this issue. Thanks!
Create a getCommandParameters
inside the /utils
folder to simplify and unify the function to get the parameters for a command. Currently, it scatters here:
bot/src/services/bliding-ej.js
Lines 8 to 9 in 502177e
Lines 62 to 66 in 502177e
bot/src/services/covid/index.js
Lines 14 to 15 in 502177e
bot/src/services/eval/index.js
Lines 13 to 18 in d1d915d
It is found that String.substring()
is the fastest way to implement this. Try to put this JSBin code into JSBench. You'll find this result:
Buat fungsi getCommandParameters
di dalam folder /utils
untuk menyederhanakan & menyatukan fungsi yang digunakan untuk ambil parameter dari command. Sekarang, fungsi-fungsi ini tersebar di:
bot/src/services/bliding-ej.js
Lines 8 to 9 in 502177e
Lines 62 to 66 in 502177e
bot/src/services/covid/index.js
Lines 14 to 15 in 502177e
bot/src/services/eval/index.js
Lines 13 to 18 in d1d915d
Sudah di benchmark dan ternyata String.substring()
adalah cara tercepat dibandingkan 2 cara lain. Coba taruh kode JSBin ini ke JSBench. Kamu bakal nemuin hasil ini:
use this as a test case: https://caniuse.com/css-grid
just add it into the handler lists, no need to think about how to call that handler. response might be only the supported device.
example response:
IE: partially supported
Edge: supported
Firefox: supported
Chrome: supported
Safari: supported
Opera: supported
Safari on iOS: supported
Opera Mini: not supported
Android Browser: supported
...
cc @elianiva
/hilih
command here: https://github.com/teknologi-umum/bot/blob/master/src/services/meme/index.jsbiar ga lupa
Ini ntar saya pikirin lagi.
Rencananya makan dari repo rosetta tapi perlu dibikin metadata khusus agar bisa memiliki bentukan data yang bisa dikonsumi oleh bot.
you know what to do
Sentry share URL: https://sentry.io/share/issue/3a8fe798985e4a3f9e38606f485185fb/ (see this link for the stack trace of where the bug came from)
Breadcrumbs:
http GET https://html.duckduckgo.com/html/?kp=1&q=c%2B%2B+bool [200] Info 17:00:56
http GET https://stackoverflow.com/questions/1921539/using-boolean-values-in-c [200] Info 17:00:56
exception TypeError: Reduce of empty array with no initial value Error 17:00:56
Message text:
/laodeai c++ bool
From a supergroup.
Support this site: https://esolangs.org/
Should be similar to how we process Wikipedia.
Sentry share URL: https://sentry.io/share/issue/94706081554d48cd9d0613cb96437e7c/ (see that link for stack traces of where the bug came from)
Breadcrumbs:
http GET https://html.duckduckgo.com/html/?kp=1&q=rails+active+record+belongs_to+through [200] Info 16:43:32
http GET https://stackoverflow.com/questions/4021322/belongs-to-through-associations [200] Info 16:43:32
http POST https://teknologi-umum-graphene.fly.dev/api [[undefined]] Info 16:44:02
http POST https://teknologi-umum-graphene.fly.dev/api [[undefined]] Info 16:44:33
exception TimeoutError: Promise timed out after 90000 milliseconds Error 16:45:01
Message text: /laodeai rails active record belongs_to through
From a supergroup.
karena bot ini OSS, agak serakah menurutku kalau we keep it to Teknologi Umum. udah lama kepikiran biar bot ini bisa dipake di grup lain.
tapi tentu saja, harus ada beberapa hal yang di adjust biar bot ini masih aman:
/search
command (#57 #55 #54 #52 #51)/joke
, /illuminati
, /ynkts
, /kktybs
, /quote
kalo member grup nya diatas 500 orang (#46)/quiz
, /blidingej
exclusive ke grup teknologi umum (#46)/time
command (#46)/help
biar lebih helpful (#61)/kick
and /ban
command, along with /enable
and /disable
command (see #56)project issue ini lumayan jangka panjang, jangan di buru-buruin. kita semua punya kehidupan. mungkin kamu punya teman 2D yang harus diajak ngobrol.
Pas di test tembak ke API (https://api.pulo.dev/v1/contents?page=1&media=tulisan&query=typescript dan https://api.pulo.dev/v1/contents?page=1&media=web&query=typescript), masing-masing punya 1 result, jadi totalnya ada 3 result. Sedangkan bot ini ngirim 3 result seharusnya. Nah karena nggak ada result ke 3, jadinya null
dan nggak bisa di parse via Array.map()
.
Masalahnya kemungkinan besar karena ini. Harus divalidasi kalo items.length < length
dia bakal return items
seadanya aja.
bot/src/services/blog/utils.js
Lines 21 to 29 in 5f41c6b
Callernya disini:
Lines 59 to 60 in 5f41c6b
try to make the input and possible output as lowercase first, then test it against the data on mongodb to provide even cleaner safe search.
cc @elianiva
{}
without parentheses ({})
0n
scrape via https://duckduckgo.com/html/?q=url+encoded+string using cheerio
a few rules and heads up:
/src/services
and use tempura for the templating enginegood luck, have fun
Ads from DuckDuckGo search was included. Along with unnecessary query string params that broke the site we're visiting.
usage:
/enable kick
or /enable ban
rule sets:
Sanitize javascript expression then return the output
use this as a test case: https://www.man7.org/linux/man-pages/man0/stdio.h.0p.html
create a laodeai handler (https://github.com/teknologi-umum/bot/tree/master/src/services/laodeai/handlers) for that page. response/output might be:
stdio.h — standard buffered input/output
Some of the functionality described on this reference page
extends the ISO C standard. Applications shall define the
appropriate feature test macro (see the System Interfaces volume
of POSIX.1‐2017, Section 2.2, The Compilation Environment) to
enable the visibility of these symbols in this header.
The <stdio.h> header shall define the following data types
through typedef:
FILE A structure containing information about a file.
fpos_t A non-array type containing all information needed
to specify uniquely every position within a file.
off_t As described in <sys/types.h>.
size_t As described in <stddef.h>.
ssize_t As described in <sys/types.h>.
va_list As described in <stdarg.h>.
The <stdio.h> header shall define the following macros which
shall expand to integer constant expressions:
BUFSIZ Size of <stdio.h> buffers. This shall expand to a
positive value.
L_ctermid Maximum size of character array to hold ctermid()
output.
L_tmpnam Maximum size of character array to hold tmpnam()
output.
The <stdio.h> header shall define the following macros which
shall expand to integer constant expressions with distinct
values:
_IOFBF Input/output fully buffered.
_IOLBF Input/output line buffered.
_IONBF Input/output unbuffered.
The <stdio.h> header shall define the following macros which
shall expand to integer constant expressions with distinct
values:
SEEK_CUR Seek relative to current position.
SEEK_END Seek relative to end-of-file.
SEEK_SET Seek relative to start-of-file.
The <stdio.h> header shall define the following macros which
shall expand to integer constant expressions denoting
implementation limits:
{FILENAME_MAX}
Maximum size in bytes of the longest pathname that
the implementation guarantees can be opened.
{FOPEN_MAX} Number of streams which the implementation
guarantees can be open simultaneously. The value is
at least eight.
{TMP_MAX} Minimum number of unique filenames generated by
tmpnam(). Maximum number of times an application
can call tmpnam() reliably. The value of {TMP_MAX}
is at least 25.
On XSI-conformant systems, the value of {TMP_MAX}
is at least 10000.
The <stdio.h> header shall define the following macro which shall
expand to an integer constant expression with type int and a
negative value:
EOF End-of-file return value.
The <stdio.h> header shall define NULL as described in
<stddef.h>.
The <stdio.h> header shall define the following macro which shall
expand to a string constant:
P_tmpdir Default directory prefix for tempnam().
The <stdio.h> header shall define the following macros which
shall expand to expressions of type ``pointer to FILE'' that
point to the FILE objects associated, respectively, with the
standard error, input, and output streams:
stderr Standard error output stream.
stdin Standard input stream.
stdout Standard output stream.
The following shall be declared as functions and may also be
defined as macros. Function prototypes shall be provided.
void clearerr(FILE *);
char *ctermid(char *);
int dprintf(int, const char *restrict, ...)
int fclose(FILE *);
FILE *fdopen(int, const char *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE *restrict, fpos_t *restrict);
char *fgets(char *restrict, int, FILE *restrict);
int fileno(FILE *);
void flockfile(FILE *);
FILE *fmemopen(void *restrict, size_t, const char *restrict);
FILE *fopen(const char *restrict, const char *restrict);
int fprintf(FILE *restrict, const char *restrict, ...);
int fputc(int, FILE *);
int fputs(const char *restrict, FILE *restrict);
size_t fread(void *restrict, size_t, size_t, FILE *restrict);
FILE *freopen(const char *restrict, const char *restrict,
FILE *restrict);
int fscanf(FILE *restrict, const char *restrict, ...);
int fseek(FILE *, long, int);
int fseeko(FILE *, off_t, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
off_t ftello(FILE *);
int ftrylockfile(FILE *);
void funlockfile(FILE *);
size_t fwrite(const void *restrict, size_t, size_t, FILE *restrict);
int getc(FILE *);
int getchar(void);
int getc_unlocked(FILE *);
int getchar_unlocked(void);
ssize_t getdelim(char **restrict, size_t *restrict, int,
FILE *restrict);
ssize_t getline(char **restrict, size_t *restrict, FILE *restrict);
char *gets(char *);
FILE *open_memstream(char **, size_t *);
int pclose(FILE *);
void perror(const char *);
FILE *popen(const char *, const char *);
int printf(const char *restrict, ...);
int putc(int, FILE *);
int putchar(int);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
int puts(const char *);
int remove(const char *);
int rename(const char *, const char *);
int renameat(int, const char *, int, const char *);
void rewind(FILE *);
int scanf(const char *restrict, ...);
void setbuf(FILE *restrict, char *restrict);
int setvbuf(FILE *restrict, char *restrict, int, size_t);
int snprintf(char *restrict, size_t, const char *restrict, ...);
int sprintf(char *restrict, const char *restrict, ...);
int sscanf(const char *restrict, const char *restrict, ...);
char *tempnam(const char *, const char *);
FILE *tmpfile(void);
char *tmpnam(char *);
int ungetc(int, FILE *);
int vdprintf(int, const char *restrict, va_list);
int vfprintf(FILE *restrict, const char *restrict, va_list);
int vfscanf(FILE *restrict, const char *restrict, va_list);
int vprintf(const char *restrict, va_list);
int vscanf(const char *restrict, va_list);
int vsnprintf(char *restrict, size_t, const char *restrict,
va_list);
int vsprintf(char *restrict, const char *restrict, va_list);
int vsscanf(const char *restrict, const char *restrict, va_list);
Inclusion of the <stdio.h> header may also make visible all
symbols from <stddef.h>.
The following sections are informative.
might search from:
then sends the result
/covid
- info covid seluruh dunia dan indonesia
/covid <nama_negara>
- info covid di negara tertentu
Link to Sentry issues:
Occurred when doing these on a public supergroup:
/laodeai the art of productive laziness
/search chrome download via blob
A bit of help:
http GET https://en.wikipedia.org/wiki/Laziness [200] info 05:59:21
http POST https://api.telegram.org/-redacted-/sendMessage [400] info 05:59:21
exception Error: 400: Bad Request: can't parse entities: Unmatched end tag at byte offset 490, expected "</i>", found "</a>" error 05:59:21
http GET https://html.duckduckgo.com/html/?kp=1&q=chrome+download+via+blob [200] info 08:15:39
http POST https://api.telegram.org/-redacted-/sendMessage [400] info 08:15:39
exception Error: 400: Bad Request: can't parse entities: Unsupported start tag "script" at byte offset 1893 error 08:15:39
If you need more information, feel free to ask it here or in the Telegram group. Good luck.
Useful npm package for responding to the natural language: https://www.npmjs.com/package/woiasu
[2, 3, 4, 5].reduce((arr, x) => (arr.push(x), arr), [1])
There are multiple duplicates of renderTemplate
. It should be a reusable function with templatePath
parameter instead.
See:
bot/src/services/covid/utils.js
Line 19 in 2dba718
bot/src/services/blog/utils.js
Line 10 in 2dba718
bot/src/services/quote/utils.js
Line 9 in 2dba718
Kirim di private chat:
/carbon function foo() {
console.log("hello world")
}
Bot akan bikinin carbon
/laodeai similarweb google.com
Show:
if it's over 5800 characters, it will throw 504 gateway error on the Carbonara API
mungkin akan lebih baik kalo spesial hanya untuk grup teknologi umum. isi captchanya ya gausah random angka, tapi pertanyaan yang only human can answer with one word
kalo ga bales dalam 3 menit, kick. kalo jawab selain jawaban bener, kick.
Biar ga menuh menuhin chat. Daripada reply mending gambarnya dikasih caption buat mention author kodenya.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.