commit 3444a880bfe1328d987e79eaa53d98466abf3e3e Author: core Date: Mon Apr 17 17:48:11 2023 -0400 upd diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..4b7ad57 --- /dev/null +++ b/Pipfile @@ -0,0 +1,14 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +requests = "*" +"discord.py-self" = "*" +loguru = "*" + +[dev-packages] + +[requires] +python_version = "3.10" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..3ac5dfb --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,294 @@ +{ + "_meta": { + "hash": { + "sha256": "95a332486b474fe8d42478438a27c5cfd74f7cf262cd514fba7805bcbf34fd61" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.10" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "aiohttp": { + "hashes": [ + "sha256:02f46fc0e3c5ac58b80d4d56eb0a7c7d97fcef69ace9326289fb9f1955e65cfe", + "sha256:0563c1b3826945eecd62186f3f5c7d31abb7391fedc893b7e2b26303b5a9f3fe", + "sha256:114b281e4d68302a324dd33abb04778e8557d88947875cbf4e842c2c01a030c5", + "sha256:14762875b22d0055f05d12abc7f7d61d5fd4fe4642ce1a249abdf8c700bf1fd8", + "sha256:15492a6368d985b76a2a5fdd2166cddfea5d24e69eefed4630cbaae5c81d89bd", + "sha256:17c073de315745a1510393a96e680d20af8e67e324f70b42accbd4cb3315c9fb", + "sha256:209b4a8ee987eccc91e2bd3ac36adee0e53a5970b8ac52c273f7f8fd4872c94c", + "sha256:230a8f7e24298dea47659251abc0fd8b3c4e38a664c59d4b89cca7f6c09c9e87", + "sha256:2e19413bf84934d651344783c9f5e22dee452e251cfd220ebadbed2d9931dbf0", + "sha256:393f389841e8f2dfc86f774ad22f00923fdee66d238af89b70ea314c4aefd290", + "sha256:3cf75f7cdc2397ed4442594b935a11ed5569961333d49b7539ea741be2cc79d5", + "sha256:3d78619672183be860b96ed96f533046ec97ca067fd46ac1f6a09cd9b7484287", + "sha256:40eced07f07a9e60e825554a31f923e8d3997cfc7fb31dbc1328c70826e04cde", + "sha256:493d3299ebe5f5a7c66b9819eacdcfbbaaf1a8e84911ddffcdc48888497afecf", + "sha256:4b302b45040890cea949ad092479e01ba25911a15e648429c7c5aae9650c67a8", + "sha256:515dfef7f869a0feb2afee66b957cc7bbe9ad0cdee45aec7fdc623f4ecd4fb16", + "sha256:547da6cacac20666422d4882cfcd51298d45f7ccb60a04ec27424d2f36ba3eaf", + "sha256:5df68496d19f849921f05f14f31bd6ef53ad4b00245da3195048c69934521809", + "sha256:64322071e046020e8797117b3658b9c2f80e3267daec409b350b6a7a05041213", + "sha256:7615dab56bb07bff74bc865307aeb89a8bfd9941d2ef9d817b9436da3a0ea54f", + "sha256:79ebfc238612123a713a457d92afb4096e2148be17df6c50fb9bf7a81c2f8013", + "sha256:7b18b97cf8ee5452fa5f4e3af95d01d84d86d32c5e2bfa260cf041749d66360b", + "sha256:932bb1ea39a54e9ea27fc9232163059a0b8855256f4052e776357ad9add6f1c9", + "sha256:a00bb73540af068ca7390e636c01cbc4f644961896fa9363154ff43fd37af2f5", + "sha256:a5ca29ee66f8343ed336816c553e82d6cade48a3ad702b9ffa6125d187e2dedb", + "sha256:af9aa9ef5ba1fd5b8c948bb11f44891968ab30356d65fd0cc6707d989cd521df", + "sha256:bb437315738aa441251214dad17428cafda9cdc9729499f1d6001748e1d432f4", + "sha256:bdb230b4943891321e06fc7def63c7aace16095be7d9cf3b1e01be2f10fba439", + "sha256:c6e9dcb4cb338d91a73f178d866d051efe7c62a7166653a91e7d9fb18274058f", + "sha256:cffe3ab27871bc3ea47df5d8f7013945712c46a3cc5a95b6bee15887f1675c22", + "sha256:d012ad7911653a906425d8473a1465caa9f8dea7fcf07b6d870397b774ea7c0f", + "sha256:d9e13b33afd39ddeb377eff2c1c4f00544e191e1d1dee5b6c51ddee8ea6f0cf5", + "sha256:e4b2b334e68b18ac9817d828ba44d8fcb391f6acb398bcc5062b14b2cbeac970", + "sha256:e54962802d4b8b18b6207d4a927032826af39395a3bd9196a5af43fc4e60b009", + "sha256:f705e12750171c0ab4ef2a3c76b9a4024a62c4103e3a55dd6f99265b9bc6fcfc", + "sha256:f881853d2643a29e643609da57b96d5f9c9b93f62429dcc1cbb413c7d07f0e1a", + "sha256:fe60131d21b31fd1a14bd43e6bb88256f69dfc3188b3a89d736d6c71ed43ec95" + ], + "markers": "python_version >= '3.6'", + "version": "==3.7.4.post0" + }, + "async-timeout": { + "hashes": [ + "sha256:0c3c816a028d47f659d6ff5c745cb2acf1f966da1fe5c19c77a70282b25f4c5f", + "sha256:4291ca197d287d274d0b6cb5d6f8f8f82d434ed288f962539ff18cc9012f9ea3" + ], + "markers": "python_full_version >= '3.5.3'", + "version": "==3.0.1" + }, + "attrs": { + "hashes": [ + "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4", + "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==21.4.0" + }, + "certifi": { + "hashes": [ + "sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872", + "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569" + ], + "version": "==2021.10.8" + }, + "chardet": { + "hashes": [ + "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa", + "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==4.0.0" + }, + "charset-normalizer": { + "hashes": [ + "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597", + "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df" + ], + "markers": "python_version >= '3'", + "version": "==2.0.12" + }, + "discord.py-self": { + "hashes": [ + "sha256:94ac28d39f9c8f4e4af6bf2a2697cdfa09d8087a9f86e432b21a0c596042897a", + "sha256:fce2e076825d58fed4ffecb2997593f4e558143340d5e7ebd0d199f11269d5b6" + ], + "index": "pypi", + "version": "==1.9.2" + }, + "idna": { + "hashes": [ + "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff", + "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" + ], + "markers": "python_version >= '3'", + "version": "==3.3" + }, + "loguru": { + "hashes": [ + "sha256:066bd06758d0a513e9836fd9c6b5a75bfb3fd36841f4b996bc60b547a309d41c", + "sha256:4e2414d534a2ab57573365b3e6d0234dfb1d84b68b7f3b948e6fb743860a77c3" + ], + "index": "pypi", + "version": "==0.6.0" + }, + "multidict": { + "hashes": [ + "sha256:0327292e745a880459ef71be14e709aaea2f783f3537588fb4ed09b6c01bca60", + "sha256:041b81a5f6b38244b34dc18c7b6aba91f9cdaf854d9a39e5ff0b58e2b5773b9c", + "sha256:0556a1d4ea2d949efe5fd76a09b4a82e3a4a30700553a6725535098d8d9fb672", + "sha256:05f6949d6169878a03e607a21e3b862eaf8e356590e8bdae4227eedadacf6e51", + "sha256:07a017cfa00c9890011628eab2503bee5872f27144936a52eaab449be5eaf032", + "sha256:0b9e95a740109c6047602f4db4da9949e6c5945cefbad34a1299775ddc9a62e2", + "sha256:19adcfc2a7197cdc3987044e3f415168fc5dc1f720c932eb1ef4f71a2067e08b", + "sha256:19d9bad105dfb34eb539c97b132057a4e709919ec4dd883ece5838bcbf262b80", + "sha256:225383a6603c086e6cef0f2f05564acb4f4d5f019a4e3e983f572b8530f70c88", + "sha256:23b616fdc3c74c9fe01d76ce0d1ce872d2d396d8fa8e4899398ad64fb5aa214a", + "sha256:2957489cba47c2539a8eb7ab32ff49101439ccf78eab724c828c1a54ff3ff98d", + "sha256:2d36e929d7f6a16d4eb11b250719c39560dd70545356365b494249e2186bc389", + "sha256:2e4a0785b84fb59e43c18a015ffc575ba93f7d1dbd272b4cdad9f5134b8a006c", + "sha256:3368bf2398b0e0fcbf46d85795adc4c259299fec50c1416d0f77c0a843a3eed9", + "sha256:373ba9d1d061c76462d74e7de1c0c8e267e9791ee8cfefcf6b0b2495762c370c", + "sha256:4070613ea2227da2bfb2c35a6041e4371b0af6b0be57f424fe2318b42a748516", + "sha256:45183c96ddf61bf96d2684d9fbaf6f3564d86b34cb125761f9a0ef9e36c1d55b", + "sha256:4571f1beddff25f3e925eea34268422622963cd8dc395bb8778eb28418248e43", + "sha256:47e6a7e923e9cada7c139531feac59448f1f47727a79076c0b1ee80274cd8eee", + "sha256:47fbeedbf94bed6547d3aa632075d804867a352d86688c04e606971595460227", + "sha256:497988d6b6ec6ed6f87030ec03280b696ca47dbf0648045e4e1d28b80346560d", + "sha256:4bae31803d708f6f15fd98be6a6ac0b6958fcf68fda3c77a048a4f9073704aae", + "sha256:50bd442726e288e884f7be9071016c15a8742eb689a593a0cac49ea093eef0a7", + "sha256:514fe2b8d750d6cdb4712346a2c5084a80220821a3e91f3f71eec11cf8d28fd4", + "sha256:5774d9218d77befa7b70d836004a768fb9aa4fdb53c97498f4d8d3f67bb9cfa9", + "sha256:5fdda29a3c7e76a064f2477c9aab1ba96fd94e02e386f1e665bca1807fc5386f", + "sha256:5ff3bd75f38e4c43f1f470f2df7a4d430b821c4ce22be384e1459cb57d6bb013", + "sha256:626fe10ac87851f4cffecee161fc6f8f9853f0f6f1035b59337a51d29ff3b4f9", + "sha256:6701bf8a5d03a43375909ac91b6980aea74b0f5402fbe9428fc3f6edf5d9677e", + "sha256:684133b1e1fe91eda8fa7447f137c9490a064c6b7f392aa857bba83a28cfb693", + "sha256:6f3cdef8a247d1eafa649085812f8a310e728bdf3900ff6c434eafb2d443b23a", + "sha256:75bdf08716edde767b09e76829db8c1e5ca9d8bb0a8d4bd94ae1eafe3dac5e15", + "sha256:7c40b7bbece294ae3a87c1bc2abff0ff9beef41d14188cda94ada7bcea99b0fb", + "sha256:8004dca28e15b86d1b1372515f32eb6f814bdf6f00952699bdeb541691091f96", + "sha256:8064b7c6f0af936a741ea1efd18690bacfbae4078c0c385d7c3f611d11f0cf87", + "sha256:89171b2c769e03a953d5969b2f272efa931426355b6c0cb508022976a17fd376", + "sha256:8cbf0132f3de7cc6c6ce00147cc78e6439ea736cee6bca4f068bcf892b0fd658", + "sha256:9cc57c68cb9139c7cd6fc39f211b02198e69fb90ce4bc4a094cf5fe0d20fd8b0", + "sha256:a007b1638e148c3cfb6bf0bdc4f82776cef0ac487191d093cdc316905e504071", + "sha256:a2c34a93e1d2aa35fbf1485e5010337c72c6791407d03aa5f4eed920343dd360", + "sha256:a45e1135cb07086833ce969555df39149680e5471c04dfd6a915abd2fc3f6dbc", + "sha256:ac0e27844758d7177989ce406acc6a83c16ed4524ebc363c1f748cba184d89d3", + "sha256:aef9cc3d9c7d63d924adac329c33835e0243b5052a6dfcbf7732a921c6e918ba", + "sha256:b9d153e7f1f9ba0b23ad1568b3b9e17301e23b042c23870f9ee0522dc5cc79e8", + "sha256:bfba7c6d5d7c9099ba21f84662b037a0ffd4a5e6b26ac07d19e423e6fdf965a9", + "sha256:c207fff63adcdf5a485969131dc70e4b194327666b7e8a87a97fbc4fd80a53b2", + "sha256:d0509e469d48940147e1235d994cd849a8f8195e0bca65f8f5439c56e17872a3", + "sha256:d16cce709ebfadc91278a1c005e3c17dd5f71f5098bfae1035149785ea6e9c68", + "sha256:d48b8ee1d4068561ce8033d2c344cf5232cb29ee1a0206a7b828c79cbc5982b8", + "sha256:de989b195c3d636ba000ee4281cd03bb1234635b124bf4cd89eeee9ca8fcb09d", + "sha256:e07c8e79d6e6fd37b42f3250dba122053fddb319e84b55dd3a8d6446e1a7ee49", + "sha256:e2c2e459f7050aeb7c1b1276763364884595d47000c1cddb51764c0d8976e608", + "sha256:e5b20e9599ba74391ca0cfbd7b328fcc20976823ba19bc573983a25b32e92b57", + "sha256:e875b6086e325bab7e680e4316d667fc0e5e174bb5611eb16b3ea121c8951b86", + "sha256:f4f052ee022928d34fe1f4d2bc743f32609fb79ed9c49a1710a5ad6b2198db20", + "sha256:fcb91630817aa8b9bc4a74023e4198480587269c272c58b3279875ed7235c293", + "sha256:fd9fc9c4849a07f3635ccffa895d57abce554b467d611a5009ba4f39b78a8849", + "sha256:feba80698173761cddd814fa22e88b0661e98cb810f9f986c54aa34d281e4937", + "sha256:feea820722e69451743a3d56ad74948b68bf456984d63c1a92e8347b7b88452d" + ], + "markers": "python_version >= '3.7'", + "version": "==6.0.2" + }, + "requests": { + "hashes": [ + "sha256:68d7c56fd5a8999887728ef304a6d12edc7be74f1cfa47714fc8b414525c9a61", + "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d" + ], + "index": "pypi", + "version": "==2.27.1" + }, + "typing-extensions": { + "hashes": [ + "sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42", + "sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2" + ], + "markers": "python_version >= '3.6'", + "version": "==4.1.1" + }, + "urllib3": { + "hashes": [ + "sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14", + "sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", + "version": "==1.26.9" + }, + "yarl": { + "hashes": [ + "sha256:044daf3012e43d4b3538562da94a88fb12a6490652dbc29fb19adfa02cf72eac", + "sha256:0cba38120db72123db7c58322fa69e3c0efa933040ffb586c3a87c063ec7cae8", + "sha256:167ab7f64e409e9bdd99333fe8c67b5574a1f0495dcfd905bc7454e766729b9e", + "sha256:1be4bbb3d27a4e9aa5f3df2ab61e3701ce8fcbd3e9846dbce7c033a7e8136746", + "sha256:1ca56f002eaf7998b5fcf73b2421790da9d2586331805f38acd9997743114e98", + "sha256:1d3d5ad8ea96bd6d643d80c7b8d5977b4e2fb1bab6c9da7322616fd26203d125", + "sha256:1eb6480ef366d75b54c68164094a6a560c247370a68c02dddb11f20c4c6d3c9d", + "sha256:1edc172dcca3f11b38a9d5c7505c83c1913c0addc99cd28e993efeaafdfaa18d", + "sha256:211fcd65c58bf250fb994b53bc45a442ddc9f441f6fec53e65de8cba48ded986", + "sha256:29e0656d5497733dcddc21797da5a2ab990c0cb9719f1f969e58a4abac66234d", + "sha256:368bcf400247318382cc150aaa632582d0780b28ee6053cd80268c7e72796dec", + "sha256:39d5493c5ecd75c8093fa7700a2fb5c94fe28c839c8e40144b7ab7ccba6938c8", + "sha256:3abddf0b8e41445426d29f955b24aeecc83fa1072be1be4e0d194134a7d9baee", + "sha256:3bf8cfe8856708ede6a73907bf0501f2dc4e104085e070a41f5d88e7faf237f3", + "sha256:3ec1d9a0d7780416e657f1e405ba35ec1ba453a4f1511eb8b9fbab81cb8b3ce1", + "sha256:45399b46d60c253327a460e99856752009fcee5f5d3c80b2f7c0cae1c38d56dd", + "sha256:52690eb521d690ab041c3919666bea13ab9fbff80d615ec16fa81a297131276b", + "sha256:534b047277a9a19d858cde163aba93f3e1677d5acd92f7d10ace419d478540de", + "sha256:580c1f15500e137a8c37053e4cbf6058944d4c114701fa59944607505c2fe3a0", + "sha256:59218fef177296451b23214c91ea3aba7858b4ae3306dde120224cfe0f7a6ee8", + "sha256:5ba63585a89c9885f18331a55d25fe81dc2d82b71311ff8bd378fc8004202ff6", + "sha256:5bb7d54b8f61ba6eee541fba4b83d22b8a046b4ef4d8eb7f15a7e35db2e1e245", + "sha256:6152224d0a1eb254f97df3997d79dadd8bb2c1a02ef283dbb34b97d4f8492d23", + "sha256:67e94028817defe5e705079b10a8438b8cb56e7115fa01640e9c0bb3edf67332", + "sha256:695ba021a9e04418507fa930d5f0704edbce47076bdcfeeaba1c83683e5649d1", + "sha256:6a1a9fe17621af43e9b9fcea8bd088ba682c8192d744b386ee3c47b56eaabb2c", + "sha256:6ab0c3274d0a846840bf6c27d2c60ba771a12e4d7586bf550eefc2df0b56b3b4", + "sha256:6feca8b6bfb9eef6ee057628e71e1734caf520a907b6ec0d62839e8293e945c0", + "sha256:737e401cd0c493f7e3dd4db72aca11cfe069531c9761b8ea474926936b3c57c8", + "sha256:788713c2896f426a4e166b11f4ec538b5736294ebf7d5f654ae445fd44270832", + "sha256:797c2c412b04403d2da075fb93c123df35239cd7b4cc4e0cd9e5839b73f52c58", + "sha256:8300401dc88cad23f5b4e4c1226f44a5aa696436a4026e456fe0e5d2f7f486e6", + "sha256:87f6e082bce21464857ba58b569370e7b547d239ca22248be68ea5d6b51464a1", + "sha256:89ccbf58e6a0ab89d487c92a490cb5660d06c3a47ca08872859672f9c511fc52", + "sha256:8b0915ee85150963a9504c10de4e4729ae700af11df0dc5550e6587ed7891e92", + "sha256:8cce6f9fa3df25f55521fbb5c7e4a736683148bcc0c75b21863789e5185f9185", + "sha256:95a1873b6c0dd1c437fb3bb4a4aaa699a48c218ac7ca1e74b0bee0ab16c7d60d", + "sha256:9b4c77d92d56a4c5027572752aa35082e40c561eec776048330d2907aead891d", + "sha256:9bfcd43c65fbb339dc7086b5315750efa42a34eefad0256ba114cd8ad3896f4b", + "sha256:9c1f083e7e71b2dd01f7cd7434a5f88c15213194df38bc29b388ccdf1492b739", + "sha256:a1d0894f238763717bdcfea74558c94e3bc34aeacd3351d769460c1a586a8b05", + "sha256:a467a431a0817a292121c13cbe637348b546e6ef47ca14a790aa2fa8cc93df63", + "sha256:aa32aaa97d8b2ed4e54dc65d241a0da1c627454950f7d7b1f95b13985afd6c5d", + "sha256:ac10bbac36cd89eac19f4e51c032ba6b412b3892b685076f4acd2de18ca990aa", + "sha256:ac35ccde589ab6a1870a484ed136d49a26bcd06b6a1c6397b1967ca13ceb3913", + "sha256:bab827163113177aee910adb1f48ff7af31ee0289f434f7e22d10baf624a6dfe", + "sha256:baf81561f2972fb895e7844882898bda1eef4b07b5b385bcd308d2098f1a767b", + "sha256:bf19725fec28452474d9887a128e98dd67eee7b7d52e932e6949c532d820dc3b", + "sha256:c01a89a44bb672c38f42b49cdb0ad667b116d731b3f4c896f72302ff77d71656", + "sha256:c0910c6b6c31359d2f6184828888c983d54d09d581a4a23547a35f1d0b9484b1", + "sha256:c10ea1e80a697cf7d80d1ed414b5cb8f1eec07d618f54637067ae3c0334133c4", + "sha256:c1164a2eac148d85bbdd23e07dfcc930f2e633220f3eb3c3e2a25f6148c2819e", + "sha256:c145ab54702334c42237a6c6c4cc08703b6aa9b94e2f227ceb3d477d20c36c63", + "sha256:c17965ff3706beedafd458c452bf15bac693ecd146a60a06a214614dc097a271", + "sha256:c19324a1c5399b602f3b6e7db9478e5b1adf5cf58901996fc973fe4fccd73eed", + "sha256:c2a1ac41a6aa980db03d098a5531f13985edcb451bcd9d00670b03129922cd0d", + "sha256:c6ddcd80d79c96eb19c354d9dca95291589c5954099836b7c8d29278a7ec0bda", + "sha256:c9c6d927e098c2d360695f2e9d38870b2e92e0919be07dbe339aefa32a090265", + "sha256:cc8b7a7254c0fc3187d43d6cb54b5032d2365efd1df0cd1749c0c4df5f0ad45f", + "sha256:cff3ba513db55cc6a35076f32c4cdc27032bd075c9faef31fec749e64b45d26c", + "sha256:d260d4dc495c05d6600264a197d9d6f7fc9347f21d2594926202fd08cf89a8ba", + "sha256:d6f3d62e16c10e88d2168ba2d065aa374e3c538998ed04996cd373ff2036d64c", + "sha256:da6df107b9ccfe52d3a48165e48d72db0eca3e3029b5b8cb4fe6ee3cb870ba8b", + "sha256:dfe4b95b7e00c6635a72e2d00b478e8a28bfb122dc76349a06e20792eb53a523", + "sha256:e39378894ee6ae9f555ae2de332d513a5763276a9265f8e7cbaeb1b1ee74623a", + "sha256:ede3b46cdb719c794427dcce9d8beb4abe8b9aa1e97526cc20de9bd6583ad1ef", + "sha256:f2a8508f7350512434e41065684076f640ecce176d262a7d54f0da41d99c5a95", + "sha256:f44477ae29025d8ea87ec308539f95963ffdc31a82f42ca9deecf2d505242e72", + "sha256:f64394bd7ceef1237cc604b5a89bf748c95982a84bcd3c4bbeb40f685c810794", + "sha256:fc4dd8b01a8112809e6b636b00f487846956402834a7fd59d46d4f4267181c41", + "sha256:fce78593346c014d0d986b7ebc80d782b7f5e19843ca798ed62f8e3ba8728576", + "sha256:fd547ec596d90c8676e369dd8a581a21227fe9b4ad37d0dc7feb4ccf544c2d59" + ], + "markers": "python_version >= '3.6'", + "version": "==1.7.2" + } + }, + "develop": {} +} diff --git a/bot.py b/bot.py new file mode 100644 index 0000000..b78ad91 --- /dev/null +++ b/bot.py @@ -0,0 +1,293 @@ +import discord +import requests +import json +import urllib.parse +import datetime +import subprocess +import os +import binascii + +from loguru import logger + +TOKEN = 'OTQwMDY3MDk5NDI1MDA5NzU1.YgB_9Q.u95iaPy2gix5ZqrQFA_rmyK5Bzw' +IS_BOT = False # Set to false if this is a selfbot +DO_TEST = False # Set to True if you want to run test +ACTIVE_PHRASE = '$rtex' # Change to trigger phrase +RAW_ACTIVE_PHRASE = '$rawtex' # Change to trigger phrase for raw mode +EQUATION_ACTIVE_PHRASE = ';;' # Change to trigger phrase for an equation +WOLFRAM_APPKEY = 'X36K7Y-JT8GXU5698' # Change to your Wolfram|Alpha api key + +logger.info('initializing', 'bot' if IS_BOT else 'selfbot', 'mode') + +client = discord.Client() + +def upload_to_term(content): + logger.info('uploading content to pastebin') + try: + c = subprocess.run(['nc', 'termbin.com', '9999'], capture_output=True, check=True, text=True, input=content) + except subprocess.CalledProcessError as e: + logger.error('failed to upload to pastebin: ' + e.content) + return None + return c.stdout + +@client.event +async def on_ready(): + logger.info('ready') + await client.change_presence(activity=discord.Game('with math | v1.24.1')) + +tex_wrapper_start = '\\documentclass{article}\n\\usepackage{xcolor}\n\\usepackage{amsmath}\n\\begin{document}\n\\color{gray}\n' +tex_wrapper_end = '\n\\pagenumbering{gobble}\n\\end{document}' +def wrap_tex(tex): + return tex_wrapper_start + tex + tex_wrapper_end + +RTEX = 'https://rtex.probablyaweb.site/' + +def render_tex(tex): + logger.info('accepted job') + logger.info('wrapping tex') + tex = wrap_tex(tex) + logger.info('building request to rtex api') + payload = { + "code": tex, + "format": "png" + } + logger.info('build payload', payload) + logger.info(f'contacting api ({RTEX})') + logger.info('waiting for response') + response = requests.post(RTEX + 'api/v2', data=payload) + response.raise_for_status() + logger.info('decoding response') + data = response.json() + c = None + if data['status'] != 'success': + logger.error('job failed') + c = upload_to_term(data['log']) + return (False, c) + logger.info('fetching file') + uri = RTEX + 'api/v2/' + data['filename'] + logger.info(f'render job done {uri}') + return (True, uri) + +async def wolfram_get_plot_implicit(equ, qurl): + url = f'https://api.wolframalpha.com/v2/query?appid={WOLFRAM_APPKEY}&input={equ}&format=image&output=json&includepodid=ImplicitPlot' + logger.info('querying for implicit plot') + response = requests.get(url) + response.raise_for_status() + logger.info('decoding response') + data = response.json() + if data['queryresult']['success'] != True: + logger.error('query failed:', data['queryresult']['error']) + return (False, 'Sorry, but Wolfram|Alpha returned an error. Try checking on wolframalpha.com: ' + qurl) + if data['queryresult']['numpods'] > 1: + logger.error('unexpectected result, more than 1 pod') + return (False, 'Sorry, but Wolfram|Alpha returned too much data for the bot to process. Try checking on wolframalpha.com: ' + qurl) + if data['queryresult']['numpods'] < 1: + logger.warning('no graph') + return (False, 'Sorry, but I couldn\'t find any plots for that equation.') + plotpod = data['queryresult']['pods'][0] + if plotpod['id'] != 'ImplicitPlot': + logger.error('unexpected result, wrong pod id') + return (False, 'Sorry, but Wolfram|Alpha returned an unexpected response. Try checking on wolframalpha.com: ' + qurl) + plotimg = plotpod['subpods'][0]['img']['src'] + return (True, plotimg) + +async def wolfram_get_plot(equ, qurl): + url = f'https://api.wolframalpha.com/v2/query?appid={WOLFRAM_APPKEY}&input={equ}&format=image&output=json&includepodid=Plot' + logger.info('querying for plot') + response = requests.get(url) + response.raise_for_status() + logger.info('decoding response') + data = response.json() + if data['queryresult']['success'] != True: + logger.error('query failed:', data['queryresult']['error']) + return (False, 'Sorry, but Wolfram|Alpha returned an error. Try checking on wolframalpha.com: ' + qurl) + if data['queryresult']['numpods'] > 1: + logger.error('unexpectected result, more than 1 pod') + return (False, 'Sorry, but Wolfram|Alpha returned too much data for the bot to process. Try checking on wolframalpha.com: ' + qurl) + if data['queryresult']['numpods'] < 1: + logger.warning('no graph') + return (False, 'Sorry, but I couldn\'t find any plots for that equation.') + plotpod = data['queryresult']['pods'][0] + if plotpod['id'] != 'Plot': + logger.error('unexpected result, wrong pod id') + return (False, 'Sorry, but Wolfram|Alpha returned an unexpected response. Try checking on wolframalpha.com: ' + qurl) + plotimg = plotpod['subpods'][0]['img']['src'] + return (True, plotimg) + + +async def wolfram_get_plot_3d(equ, qurl): + url = f'https://api.wolframalpha.com/v2/query?appid={WOLFRAM_APPKEY}&input={equ}&format=image&output=json&includepodid=3DPlot' + logger.info('querying for plot') + response = requests.get(url) + response.raise_for_status() + logger.info('decoding response') + data = response.json() + if data['queryresult']['success'] != True: + logger.error('query failed:', data['queryresult']['error']) + return (False, 'Sorry, but Wolfram|Alpha returned an error. Try checking on wolframalpha.com: ' + qurl) + if data['queryresult']['numpods'] > 1: + logger.error('unexpectected result, more than 1 pod') + return (False, 'Sorry, but Wolfram|Alpha returned too much data for the bot to process. Try checking on wolframalpha.com: ' + qurl) + if data['queryresult']['numpods'] < 1: + logger.warning('no graph') + return (False, 'Sorry, but I couldn\'t find any plots for that equation.') + plotpod = data['queryresult']['pods'][0] + if plotpod['id'] != '3DPlot': + logger.error('unexpected result, wrong pod id') + return (False, 'Sorry, but Wolfram|Alpha returned an unexpected response. Try checking on wolframalpha.com: ' + qurl) + plotimg = plotpod['subpods'][0]['img']['src'] + return (True, plotimg) + +async def wolfram_graph3d(equation, ctx): + logger.info('job accepted, equ: ' + equation) + urlencoded = urllib.parse.quote(equation, safe='') + logger.debug('urlencoded is ' + urlencoded) + qurl = 'https://wolframalpha.com/input?i=' + urlencoded + logger.debug('qurl is ' + qurl) + logger.debug('done, creating embed') + success, msg = await wolfram_get_plot_3d(urlencoded, qurl) + if not success: + logger.error('failed') + await ctx.reply('Sorry, but something went wrong while rendering your equation:\n```' + msg + '\n```') + return + else: + await ctx.reply(msg) + return + +async def wolfram_graph(equation, ctx): + logger.info('job accepted, equ: ' + equation) + urlencoded = urllib.parse.quote(equation, safe='') + logger.debug('urlencoded is ' + urlencoded) + qurl = 'https://wolframalpha.com/input?i=' + urlencoded + logger.debug('qurl is ' + qurl) + logger.debug('done, creating embed') + success, msg = await wolfram_get_plot(urlencoded, qurl) + if not success: + logger.info('try 1 failed, attempting implicit plotting') + success, msgi = await wolfram_get_plot_implicit(urlencoded, qurl) + if not success: + logger.error('failed') + await ctx.reply('Sorry, but something went wrong while rendering your equation:\n```' + msg + '\n' + msgi + '\n```') + return + logger.info('implicit plot found') + await ctx.reply(msgi) + return + else: + await ctx.reply(msg) + return + # selfbots cant use embeds :( + #imgurl = plotimg + #queryurl = 'https://wolframalpha.com/input?i=' + urlencoded + #embed = discord.Embed( + # title='Graph: ' + equation, + # url=queryurl, + # timestamp=datetime.datetime.now(), + # footer='Made with <3 by c0repwn3r', + # description='Here\'s your plot!' + #) + #embed.set_author(name='Wolfram|Alpha', icon_url='https://wolframalpha.com/favicon.ico') + #embed.set_image(url=imgurl) + #await ctx.channel.send(imgurl) + #return + +def test_render_engine(): + logger.info('testing rendering engine') + if render_tex('lbtest')[0] == False: + logger.warning('render test 1 failed, attempting render 2') + if render_tex('ftest')[0] == False: + logger.error('render test failed, exiting') + exit(-1) + logger.info('render test successful') + +if DO_TEST: + test_render_engine() +else: + logger.info('skipping rendering test') + +logger.info('creating msg event handler') + +@client.event +async def on_message(message): + if message.author == client.user: + logger.debug('ignoring my own message') + return + if message.content in ['.authtest', '.help', '.embed', '.dumpconfig', '.writeconfig'] or message.content.startswith('.graphequ3d') or message.content.startswith('.writeconfig') or ACTIVE_PHRASE in message.content or RAW_ACTIVE_PHRASE in message.content or len(message.content.split(EQUATION_ACTIVE_PHRASE)) > 2 or message.content.startswith('.graphequ'): + async with message.channel.typing(): + await process_message(message) + +async def process_message(message): + global config + logger.info('processing message') + if message.author == client.user: + logger.debug('ignoring my own message') + return + if message.content == '.dumpconfig': + await message.reply(json.dumps(config)) + return + elif message.content == '.authtest': + await message.reply(f'Hi there! Unfortunately, I\'m not authorized to issue authentication codes for you. Check with core if you should be able to get one. Sorry :/') +# await message.reply(f'Hi! Your auth code is `{binascii.b2a_hex(os.urandom(3))[2:-1]}`. It will be valid for 60 seconds.\n**Nobody should be asking you for this code. Ensure that your browser shows the URL https://hotel.security.internalwg.e3t.cc/discord_3fa, otherwise you might compromise access to the VPN.**') + return + elif message.content.startswith('.writeconfig'): + newconfig = ' '.join(message.content.split(' ')[1:]) + config = newconfig + write_config() + await message.reply('Updated config.') + return + elif message.content.startswith('.graphequ3d'): + equation = message.content[12:] + logger.info('job accepted (equation', equation, 'TBR by Wolfram in 3d)') + await wolfram_graph3d(equation, message) + return + elif message.content.startswith('.graphequ'): + equation = message.content[10:] + logger.info('job accepted (equation', equation, 'TBR by Wolfram)') + await wolfram_graph(equation, message) + return + elif message.content == '.embed': + embed=discord.Embed(title="Test Embed", url="https://coredoes.dev", description="This is an embed to figure out what discord.py is doing.") + await message.channel.send(embed=embed) + return + elif message.content == '.help': + await message.channel.send(":wave: **Hi, I'm c0remath3r**\nI'm a math bot with several functions, but primarily rendering LaTeX expressions and querying Wolfram|Alpha right within discord. Here's how it works!\r**To render an entire message as a LaTeX document^**: place \$rtex *somewhere* in your message. It does not matter where.\nAn easier way to do this, however, is to simply **surround the equation you want to render with \;\;^** which will render it as an equation, and the rest of the message as text.\n*^: some preprocessing is applied.*\n\n**To graph an equation:** simply write `.graphequ `. This will query Wolfram|Alpha to fetch a (implicit, if nessecary) plot and will send it in the channel.\n**For 3-D graphs:** simply use `.graphequ3d ` instead.\n\nHave fun!") + return + content = '' + if RAW_ACTIVE_PHRASE in message.content: + logger.info('found raw trigger phrase, processing') + logger.debug('preprocessing: removing trigger phrase') + content = message.content.replace(RAW_ACTIVE_PHRASE, '') + logger.info('rendering') + url = render_tex(content) + if url[0]: + logger.error('rendering failed, notifying user') + await message.reply('Sorry, but I failed to render your message. Please try again later or contact core.\nYou can also check the render log: ' + url[1]) + else: + logger.info('rendered, replying') + await message.reply(url[1]) + if len(message.content.split(EQUATION_ACTIVE_PHRASE)) >= 3: + logger.info('found equation message, processing') + logger.debug('preprocessing: modifying equation phrases') + content = message.content.replace(EQUATION_ACTIVE_PHRASE, '$') + logger.info('rendering') + url = render_tex(content) + if url[0] == False: + logger.error('rendering failed, notifying user') + await message.reply('Sorry, but I failed to render your message. Please try again later or contact core.\nYou can also check the render log: ' + url[1]) + else: + logger.info('rendered, replying') + await message.reply(url[1]) + if ACTIVE_PHRASE in message.content: + logger.info('found trigger phrase, processing') + logger.debug('preprocessing (trigger phrase removal)') + content = message.content.replace(ACTIVE_PHRASE, '') + logger.info('rendering') + url = render_tex(content) + if url[0] == False: + logger.error('rendering failed, notifying user') + await message.reply('Sorry, but I failed to render your message. Please try again later or contact core.\nYou can also check the render log: ' + url[1]) + else: + logger.info('rendered, replying') + await message.reply(url[1]) + +logger.info('ready to initialize, logging in') +client.run(TOKEN) diff --git a/config.json b/config.json new file mode 100644 index 0000000..6f80149 --- /dev/null +++ b/config.json @@ -0,0 +1 @@ +"{\"trigger\": {\"default\": \"$sdof\", \"raw\": \"$rawtex\", \"equation\": \"$$\"}, \"packages\": [\"xcolor\", \"amsmath\"], \"package_code\": \"\\usepackage{package}\", \"precode\": [\"\\documentclass{article}\", \"@INC_PKGS\", \"\\begin{document}\", \"\\color{gray}\"], \"postcode\": [\"\\pagenumbering{gobble}\", \"\\end{document}\"]}" \ No newline at end of file diff --git a/config.py b/config.py new file mode 100644 index 0000000..21c5bbb --- /dev/null +++ b/config.py @@ -0,0 +1,48 @@ +import configparser + +class Config: + + + def generate_config(self): + print('config: generating configuration file') + self.config = configparser.ConfigParser() + self.config['trigger'] = { + 'active': '$rtex', + 'raw': '$rawtex', + 'equation': ';;', + 'command': '$' + } + self.config['packages'] = [ + 'xcolor', + 'amsmath' + ] + self.config['package_code'] = '\\usepackage{@PKG_NAME}' + self.config['precode'] = [ + '\\documentclass{article}', + '@INC_PKGS', + '\\begin{document}', + '\\color{gray}' + ] + self.config['postcode'] = [ + '\\pagenumbering{gobble}', + '\\end{document}' + ] + self.config['login'] = { + 'type': 'user', + 'token': 'Token goes here' + } + self.write_config() + + def write_config(self): + print('config: updating configuration file') + with open('config.ini', 'w') as cf: + self.config.write(cf) + print('config: written, syncing internal config representation') + self.read_config() + + def read_config(self): + print('config: updating internal config from file') + self.config.read('config.ini') + + def watch_config(self): + print('config: setting up file watcher') diff --git a/log.txt b/log.txt new file mode 100644 index 0000000..d439f29 --- /dev/null +++ b/log.txt @@ -0,0 +1,5 @@ +bot: initializing selfbot mode +bot: skipping rendering test +bot: creating msg event handler +bot: ready to initialize, logging in +bot: ready diff --git a/preprocessing.json b/preprocessing.json new file mode 100644 index 0000000..40f3caa --- /dev/null +++ b/preprocessing.json @@ -0,0 +1,5 @@ +{ + "do_preprocessing": true, + "preprocess_start": "\\documentclass{article}\n\\usepackage{xcolor}\\usepackage{amsmath}\n\\begin{document}\n", + "preprocess_end": "\\end{document}" +}