goodclover / osm-discord-bot Goto Github PK
View Code? Open in Web Editor NEWDiscord bot that works with OpenStreetMap data. (MAINTAINANCE MODE)
License: Other
Discord bot that works with OpenStreetMap data. (MAINTAINANCE MODE)
License: Other
The current code is a monolithic one-file mess.
At some point the following should probably be done:
main.py
that should probably be moved to the config.discord.py
doesn't have them (slash-command I think does).At line 742, regex currently supports only formats like node/1234
. Requesting feature to support phrases like nodes 1, 2, 5 and 6 or 3
.
Half-tested solution ELM_INLINE_REGEX = rf"{SS}(node|way|relation)(?:s? |\/)({POS_INT}(?:(?:, | and | or | )(?:{POS_INT}))*){SE}
. It might be good or bad idea to unify similar regex for lines 742, 743 and 744. New regex supports array separators ,
, and
and or
while accepting old node/123
format.
Lines 742 to 744 in 1901b57
Additional group-based regex processing may need to be implemented in on_message()
. Since regex doesn't support repeating capturing groups, entire list of element ID-s are matched as single group (e.g 1, 2, 5 and 6 or 3
) and needs next regex to match each {POS_INT}
to find element ID-s individually.
For example line 755 becomes elms = [(elm[0], tuple(re.findall('\d+', elm[1]))) for elm in re.findall(ELM_INLINE_REGEX, msg.clean_content)
instead of
Line 755 in 1901b57
PS. There's typo in readme.
Line 23 in 1901b57
At current /close_suggestion
is shown in the list for people that don't have permission.
There is a check in place to make sure they are allowed, but it still shows in the list of commands.
I'm not sure if Discord supports this, maybe it would be good to split all powerful commands into a simple /power
or /admin
and then use sub-commands for the individual things?
If OSM-Discord-bot is going to replace Dyno's custom commands, it would be nice if it supported accepting and rejecting the posted suggestions in the form of a moderator-only command that could refer to the suggestion's (TBI) ID.
This would either append to the original message or create a reply with a message like "Suggestion X has been accepted/rejected".
To show bot in the action.
At current, Matrix users are unable to use slash-commands, but they can use inline detection or "traditional" commands (e.g. ?help
).
Adding the ability for the bot to detect if a message starts with /
, and then treat it like a slash command would enable bridged users to use the commands.
Note that bridged users appear as bots.
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.